diff --git a/swaggerci/consumption/.gitattributes b/swaggerci/consumption/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/swaggerci/consumption/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/swaggerci/consumption/.gitignore b/swaggerci/consumption/.gitignore new file mode 100644 index 000000000000..7998f37e1e47 --- /dev/null +++ b/swaggerci/consumption/.gitignore @@ -0,0 +1,5 @@ +bin +obj +.vs +tools +test/*-TestResults.xml \ No newline at end of file diff --git a/swaggerci/consumption/Az.Consumption.csproj b/swaggerci/consumption/Az.Consumption.csproj new file mode 100644 index 000000000000..3844f71ca417 --- /dev/null +++ b/swaggerci/consumption/Az.Consumption.csproj @@ -0,0 +1,44 @@ + + + + 0.1.0 + 7.1 + netstandard2.0 + Library + Az.Consumption.private + Microsoft.Azure.PowerShell.Cmdlets.Consumption + true + false + ./bin + $(OutputPath) + Az.Consumption.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/consumption/Az.Consumption.format.ps1xml b/swaggerci/consumption/Az.Consumption.format.ps1xml new file mode 100644 index 000000000000..98f1a2148e31 --- /dev/null +++ b/swaggerci/consumption/Az.Consumption.format.ps1xml @@ -0,0 +1,5275 @@ + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.ConsumptionIdentity + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.ConsumptionIdentity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BillingAccountId + + + BillingPeriodName + + + BillingProfileId + + + BudgetName + + + CustomerId + + + Id + + + ManagementGroupId + + + ReservationId + + + ReservationOrderId + + + ResourceScope + + + Scope + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount + + + + + + + + + + + + + + + Currency + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate + + + + + + + + + + + + + + + + + + + + + Currency + + + Value + + + ExchangeRate + + + ExchangeRateMonth + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Balance + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Balance + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalanceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalanceProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Adjustment + + + AzureMarketplaceServiceCharge + + + BeginningBalance + + + BillingFrequency + + + ChargesBilledSeparately + + + Currency + + + EndingBalance + + + NewPurchase + + + PriceHidden + + + ServiceOverage + + + TotalOverage + + + TotalUsage + + + Utilized + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesAdjustmentDetailsItem + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesAdjustmentDetailsItem + + + + + + + + + + + + + + + Name + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesNewPurchasesDetailsItem + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesNewPurchasesDetailsItem + + + + + + + + + + + + + + + Name + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Budget + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Budget + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpression + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpression + + + + + + + + + + + + + + + + + + Name + + + Operator + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetProperties + + + + + + + + + + + + + + + + + + Amount + + + Category + + + TimeGrain + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetsListResult + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetTimePeriod + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetTimePeriod + + + + + + + + + + + + + + + EndDate + + + StartDate + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ChargeSummary + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ChargeSummary + + + + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditSummary + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditSummary + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditSummaryProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditSummaryProperties + + + + + + + + + + + + + + + + + + BillingCurrency + + + CreditCurrency + + + ETag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CurrentSpend + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CurrentSpend + + + + + + + + + + + + + + + Amount + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.DownloadProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.DownloadProperties + + + + + + + + + + + + + + + DownloadUrl + + + ValidTill + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorDetails + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorDetails + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.EventProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.EventProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BillingCurrency + + + BillingProfileDisplayName + + + BillingProfileId + + + CreditCurrency + + + Description + + + ETag + + + EventType + + + InvoiceNumber + + + LotId + + + LotSource + + + TransactionDate + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Events + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Events + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.EventSummary + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.EventSummary + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ForecastSpend + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ForecastSpend + + + + + + + + + + + + + + + Amount + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.HighCasedErrorDetails + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.HighCasedErrorDetails + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyChargeSummary + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyChargeSummary + + + + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Kind + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyChargeSummaryProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyChargeSummaryProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AzureCharge + + + AzureMarketplaceCharge + + + BillingPeriodId + + + ChargesBilledSeparately + + + Currency + + + UsageEnd + + + UsageStart + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendation + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Kind + + + Location + + + Name + + + Sku + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendationProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendationProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CostWithNoReservedInstance + + + FirstUsageDate + + + InstanceFlexibilityGroup + + + InstanceFlexibilityRatio + + + LookBackPeriod + + + MeterId + + + NetSaving + + + NormalizedSize + + + RecommendedQuantity + + + RecommendedQuantityNormalized + + + ResourceType + + + Scope + + + Term + + + TotalCostWithReservedInstance + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationTransaction + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationTransaction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccountName + + + AccountOwnerEmail + + + Amount + + + ArmSkuName + + + BillingFrequency + + + BillingMonth + + + CostCenter + + + Currency + + + CurrentEnrollment + + + DepartmentName + + + Description + + + EventDate + + + EventType + + + Id + + + MonetaryCommitment + + + Name + + + Overage + + + PurchasingEnrollment + + + PurchasingSubscriptionGuid + + + PurchasingSubscriptionName + + + Quantity + + + Region + + + ReservationOrderId + + + ReservationOrderName + + + Tag + + + Term + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationTransactionProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationTransactionProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccountName + + + AccountOwnerEmail + + + Amount + + + ArmSkuName + + + BillingFrequency + + + BillingMonth + + + CostCenter + + + Currency + + + CurrentEnrollment + + + DepartmentName + + + Description + + + EventDate + + + EventType + + + MonetaryCommitment + + + Overage + + + PurchasingEnrollment + + + PurchasingSubscriptionGuid + + + PurchasingSubscriptionName + + + Quantity + + + Region + + + ReservationOrderId + + + ReservationOrderName + + + Term + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacySharedScopeReservationRecommendationProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacySharedScopeReservationRecommendationProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CostWithNoReservedInstance + + + FirstUsageDate + + + InstanceFlexibilityGroup + + + InstanceFlexibilityRatio + + + LookBackPeriod + + + MeterId + + + NetSaving + + + NormalizedSize + + + RecommendedQuantity + + + RecommendedQuantityNormalized + + + ResourceType + + + Scope + + + Term + + + TotalCostWithReservedInstance + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacySingleScopeReservationRecommendationProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacySingleScopeReservationRecommendationProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CostWithNoReservedInstance + + + FirstUsageDate + + + InstanceFlexibilityGroup + + + InstanceFlexibilityRatio + + + LookBackPeriod + + + MeterId + + + NetSaving + + + NormalizedSize + + + RecommendedQuantity + + + RecommendedQuantityNormalized + + + ResourceType + + + Scope + + + Term + + + TotalCostWithReservedInstance + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyUsageDetail + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyUsageDetail + + + + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Kind + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyUsageDetailProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyUsageDetailProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccountName + + + AccountOwnerId + + + AdditionalInfo + + + BenefitId + + + BenefitName + + + BillingAccountId + + + BillingAccountName + + + BillingCurrency + + + BillingPeriodEndDate + + + BillingPeriodStartDate + + + BillingProfileId + + + BillingProfileName + + + ChargeType + + + ConsumedService + + + Cost + + + CostCenter + + + Date + + + EffectivePrice + + + Frequency + + + InvoiceSection + + + IsAzureCreditEligible + + + MeterId + + + OfferId + + + PartNumber + + + PayGPrice + + + PlanName + + + PricingModel + + + Product + + + ProductOrderId + + + ProductOrderName + + + PublisherName + + + PublisherType + + + Quantity + + + ReservationId + + + ReservationName + + + ResourceGroup + + + ResourceId + + + ResourceLocation + + + ResourceName + + + ServiceInfo1 + + + ServiceInfo2 + + + SubscriptionId + + + SubscriptionName + + + Term + + + UnitPrice + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LotProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LotProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BillingCurrency + + + CreditCurrency + + + ETag + + + ExpirationDate + + + PoNumber + + + PurchasedDate + + + Source + + + StartDate + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Lots + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Lots + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LotSummary + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LotSummary + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AzureCharge + + + BillingPeriodId + + + ChargesBilledSeparately + + + Currency + + + ExcludedSubscription + + + IncludedSubscription + + + MarketplaceCharge + + + UsageEnd + + + UsageStart + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostResult + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostResult + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Marketplace + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Marketplace + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MarketplaceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MarketplaceProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccountName + + + AdditionalInfo + + + AdditionalProperty + + + BillingPeriodId + + + ConsumedQuantity + + + ConsumedService + + + CostCenter + + + Currency + + + DepartmentName + + + InstanceId + + + InstanceName + + + IsEstimated + + + IsRecurringCharge + + + MeterId + + + OfferName + + + OrderNumber + + + PlanName + + + PretaxCost + + + PublisherName + + + ResourceGroup + + + ResourceRate + + + SubscriptionGuid + + + SubscriptionName + + + UnitOfMeasure + + + UsageEnd + + + UsageStart + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MarketplacesListResult + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MarketplacesListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetails + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MeterCategory + + + MeterLocation + + + MeterName + + + MeterSubCategory + + + PretaxStandardRate + + + ServiceName + + + ServiceTier + + + TotalIncludedQuantity + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsResponse + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsResponse + + + + + + + + + + + + + + + + + + + + + + + + MeterCategory + + + MeterName + + + MeterSubCategory + + + ServiceFamily + + + UnitOfMeasure + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernChargeSummary + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernChargeSummary + + + + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Kind + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernChargeSummaryProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernChargeSummaryProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BillingAccountId + + + BillingPeriodId + + + BillingProfileId + + + CustomerId + + + InvoiceSectionId + + + IsInvoiced + + + UsageEnd + + + UsageStart + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendation + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Kind + + + Location + + + Name + + + Sku + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendationProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendationProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FirstUsageDate + + + InstanceFlexibilityGroup + + + InstanceFlexibilityRatio + + + Location + + + LookBackPeriod + + + MeterId + + + NormalizedSize + + + RecommendedQuantity + + + RecommendedQuantityNormalized + + + ResourceType + + + Scope + + + SkuName + + + Term + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransaction + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransaction + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Tag + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransactionProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransactionProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Amount + + + ArmSkuName + + + BillingFrequency + + + BillingProfileId + + + BillingProfileName + + + Currency + + + Description + + + EventDate + + + EventType + + + Invoice + + + InvoiceId + + + InvoiceSectionId + + + InvoiceSectionName + + + PurchasingSubscriptionGuid + + + PurchasingSubscriptionName + + + Quantity + + + Region + + + ReservationOrderId + + + ReservationOrderName + + + Term + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransactionsListResult + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransactionsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernSharedScopeReservationRecommendationProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernSharedScopeReservationRecommendationProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CostWithNoReservedInstanceCurrency + + + CostWithNoReservedInstanceValue + + + FirstUsageDate + + + InstanceFlexibilityGroup + + + InstanceFlexibilityRatio + + + Location + + + LookBackPeriod + + + MeterId + + + NetSavingCurrency + + + NetSavingValue + + + NormalizedSize + + + RecommendedQuantity + + + RecommendedQuantityNormalized + + + ResourceType + + + Scope + + + SkuName + + + Term + + + TotalCostWithReservedInstanceCurrency + + + TotalCostWithReservedInstanceValue + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernSingleScopeReservationRecommendationProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernSingleScopeReservationRecommendationProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CostWithNoReservedInstanceCurrency + + + CostWithNoReservedInstanceValue + + + FirstUsageDate + + + InstanceFlexibilityGroup + + + InstanceFlexibilityRatio + + + Location + + + LookBackPeriod + + + MeterId + + + NetSavingCurrency + + + NetSavingValue + + + NormalizedSize + + + RecommendedQuantity + + + RecommendedQuantityNormalized + + + ResourceType + + + Scope + + + SkuName + + + Term + + + TotalCostWithReservedInstanceCurrency + + + TotalCostWithReservedInstanceValue + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernUsageDetail + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernUsageDetail + + + + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Kind + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernUsageDetailProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernUsageDetailProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AdditionalInfo + + + BenefitId + + + BenefitName + + + BillingAccountId + + + BillingAccountName + + + BillingCurrencyCode + + + BillingPeriodEndDate + + + BillingPeriodStartDate + + + BillingProfileId + + + BillingProfileName + + + ChargeType + + + ConsumedService + + + CostAllocationRuleName + + + CostCenter + + + CostInBillingCurrency + + + CostInPricingCurrency + + + CostInUsd + + + CustomerName + + + CustomerTenantId + + + Date + + + EffectivePrice + + + ExchangeRate + + + ExchangeRateDate + + + ExchangeRatePricingToBilling + + + Frequency + + + InstanceName + + + InvoiceId + + + InvoiceSectionId + + + InvoiceSectionName + + + IsAzureCreditEligible + + + MarketPrice + + + MeterCategory + + + MeterId + + + MeterName + + + MeterRegion + + + MeterSubCategory + + + PartnerEarnedCreditApplied + + + PartnerEarnedCreditRate + + + PartnerName + + + PartnerTenantId + + + PayGPrice + + + PaygCostInBillingCurrency + + + PaygCostInUsd + + + PreviousInvoiceId + + + PricingCurrencyCode + + + PricingModel + + + Product + + + ProductIdentifier + + + ProductOrderId + + + ProductOrderName + + + Provider + + + PublisherId + + + PublisherName + + + PublisherType + + + Quantity + + + ResellerMpnId + + + ResellerName + + + ReservationId + + + ReservationName + + + ResourceGroup + + + ResourceLocation + + + ResourceLocationNormalized + + + ServiceFamily + + + ServiceInfo1 + + + ServiceInfo2 + + + ServicePeriodEndDate + + + ServicePeriodStartDate + + + SubscriptionGuid + + + SubscriptionName + + + Term + + + UnitOfMeasure + + + UnitPrice + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Notification + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Notification + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ContactEmail + + + ContactGroup + + + ContactRole + + + Enabled + + + Locale + + + Operator + + + Threshold + + + ThresholdType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Operation + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Operation + + + + + + + + + + + + + + + Id + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.OperationDisplay + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.OperationDisplay + + + + + + + + + + + + + + + + + + + + + Description + + + Operation + + + Provider + + + Resource + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.OperationListResult + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.OperationListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetModel + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetModel + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BillingPeriodId + + + CurrencyCode + + + IncludedQuantity + + + MeterId + + + OfferId + + + PartNumber + + + UnitOfMeasure + + + UnitPrice + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetResult + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetResult + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ProxyResource + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ProxyResource + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Reseller + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Reseller + + + + + + + + + + + + + + + Description + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetail + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetail + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + InstanceFlexibilityGroup + + + InstanceFlexibilityRatio + + + InstanceId + + + Kind + + + ReservationId + + + ReservationOrderId + + + ReservedHour + + + SkuName + + + TotalReservedQuantity + + + UsageDate + + + UsedHour + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailsListResult + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendation + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Location + + + Name + + + Sku + + + Type + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsCalculatedSavingsProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsCalculatedSavingsProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnDemandCost + + + OverageCost + + + Quantity + + + ReservationCost + + + ReservedUnitCount + + + Saving + + + TotalReservationCost + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsModel + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsModel + + + + + + + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + Location + + + Sku + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsProperties + + + + + + + + + + + + + + + + + + Currency + + + ResourceGroup + + + Scope + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsResourceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsResourceProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + AppliedScope + + + OnDemandRate + + + Product + + + Region + + + ReservationRate + + + ResourceType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsSavingsProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsSavingsProperties + + + + + + + + + + + + + + + + + + + + + + + + LookBackPeriod + + + RecommendedQuantity + + + ReservationOrderTerm + + + SavingsType + + + UnitOfMeasure + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsUsageProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsUsageProperties + + + + + + + + + + + + + + + + + + + + + + + + FirstConsumptionDate + + + LastConsumptionDate + + + LookBackUnitType + + + UsageData + + + UsageGrain + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationsListResult + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationsListResult + + + + + + + + + + + + + + + NextLink + + + PreviousLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummariesListResult + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummariesListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummary + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummary + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummaryProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummaryProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AvgUtilizationPercentage + + + Kind + + + MaxUtilizationPercentage + + + MinUtilizationPercentage + + + PurchasedQuantity + + + RemainingQuantity + + + ReservationId + + + ReservationOrderId + + + ReservedHour + + + SkuName + + + TotalReservedQuantity + + + UsageDate + + + UsedHour + + + UsedQuantity + + + UtilizedPercentage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransaction + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransaction + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Tag + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransactionResource + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransactionResource + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Tag + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransactionsListResult + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransactionsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceAttributes + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceAttributes + + + + + + + + + + + + + + + Location + + + Sku + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuProperty + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuProperty + + + + + + + + + + + + + + + Name + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Tag + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Tag + + + + + + + + + + + + + + + Key + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagProperties + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagProperties + + + + + + + + + + + + + + + NextLink + + + PreviousLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagsResult + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagsResult + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.UsageDetail + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.UsageDetail + + + + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.UsageDetailsListResult + + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.UsageDetailsListResult + + + + + + + + + + + + NextLink + + + + + + + + \ No newline at end of file diff --git a/swaggerci/consumption/Az.Consumption.nuspec b/swaggerci/consumption/Az.Consumption.nuspec new file mode 100644 index 000000000000..5d6a4d4f9d8d --- /dev/null +++ b/swaggerci/consumption/Az.Consumption.nuspec @@ -0,0 +1,32 @@ + + + + Az.Consumption + 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/consumption/Az.Consumption.psd1 b/swaggerci/consumption/Az.Consumption.psd1 new file mode 100644 index 000000000000..a3266488e40a --- /dev/null +++ b/swaggerci/consumption/Az.Consumption.psd1 @@ -0,0 +1,24 @@ +@{ + GUID = 'd69ac069-c210-4d4a-bd87-0d16642075b1' + RootModule = './Az.Consumption.psm1' + ModuleVersion = '0.1.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: Consumption cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.Consumption.private.dll' + FormatsToProcess = './Az.Consumption.format.ps1xml' + FunctionsToExport = 'Get-AzConsumptionAggregatedCost', 'Get-AzConsumptionBalance', 'Get-AzConsumptionBudget', 'Get-AzConsumptionCharge', 'Get-AzConsumptionCredit', 'Get-AzConsumptionEvent', 'Get-AzConsumptionLot', 'Get-AzConsumptionMarketplace', 'Get-AzConsumptionPriceSheet', 'Get-AzConsumptionReservationDetail', 'Get-AzConsumptionReservationRecommendation', 'Get-AzConsumptionReservationRecommendationDetail', 'Get-AzConsumptionReservationsDetail', 'Get-AzConsumptionReservationsSummary', 'Get-AzConsumptionReservationSummary', 'Get-AzConsumptionReservationTransaction', 'Get-AzConsumptionTag', 'Get-AzConsumptionUsageDetail', 'New-AzConsumptionBudget', 'Remove-AzConsumptionBudget', '*' + AliasesToExport = '*' + PrivateData = @{ + PSData = @{ + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Consumption' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } +} diff --git a/swaggerci/consumption/Az.Consumption.psm1 b/swaggerci/consumption/Az.Consumption.psm1 new file mode 100644 index 000000000000..847cbbf4c6a7 --- /dev/null +++ b/swaggerci/consumption/Az.Consumption.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.Consumption.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/MSSharedLibKey.snk b/swaggerci/consumption/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/swaggerci/consumption/MSSharedLibKey.snk differ diff --git a/swaggerci/consumption/README.md b/swaggerci/consumption/README.md new file mode 100644 index 000000000000..b6d1c88fb8af --- /dev/null +++ b/swaggerci/consumption/README.md @@ -0,0 +1,27 @@ + +# Az.Consumption +This directory contains the PowerShell module for the Consumption service. + +--- +## Status +[![Az.Consumption](https://img.shields.io/powershellgallery/v/Az.Consumption.svg?style=flat-square&label=Az.Consumption "Az.Consumption")](https://www.powershellgallery.com/packages/Az.Consumption/) + +## 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.Consumption`, see [how-to.md](how-to.md). + diff --git a/swaggerci/consumption/build-module.ps1 b/swaggerci/consumption/build-module.ps1 new file mode 100644 index 000000000000..47c496dbfb4e --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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.Consumption.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.Consumption.psd1' +$guid = Get-ModuleGuid -Psd1Path $psd1 +$moduleName = 'Az.Consumption' +$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: Consumption 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.Consumption.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/consumption/check-dependencies.ps1 b/swaggerci/consumption/check-dependencies.ps1 new file mode 100644 index 000000000000..ec3055201a71 --- /dev/null +++ b/swaggerci/consumption/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/consumption/create-model-cmdlets.ps1 b/swaggerci/consumption/create-model-cmdlets.ps1 new file mode 100644 index 000000000000..5720d57bfa56 --- /dev/null +++ b/swaggerci/consumption/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 = 'Consumption' + $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/consumption/custom/Az.Consumption.custom.psm1 b/swaggerci/consumption/custom/Az.Consumption.custom.psm1 new file mode 100644 index 000000000000..19940cd27529 --- /dev/null +++ b/swaggerci/consumption/custom/Az.Consumption.custom.psm1 @@ -0,0 +1,17 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Consumption.private.dll') + + # Load the internal module + $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.Consumption.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/consumption/custom/README.md b/swaggerci/consumption/custom/README.md new file mode 100644 index 000000000000..d1ef67b69c8a --- /dev/null +++ b/swaggerci/consumption/custom/README.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.Consumption` 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.Consumption.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.Consumption` 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.Consumption.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.Consumption.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.Consumption`. 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.Consumption.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.Consumption.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Consumption`. +- `Microsoft.Azure.PowerShell.Cmdlets.Consumption.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.Consumption`. For more information, see [README.md](../internal/README.md) in the `../internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/docs/Az.Consumption.md b/swaggerci/consumption/docs/Az.Consumption.md new file mode 100644 index 000000000000..1c794de580bc --- /dev/null +++ b/swaggerci/consumption/docs/Az.Consumption.md @@ -0,0 +1,88 @@ +--- +Module Name: Az.Consumption +Module Guid: d69ac069-c210-4d4a-bd87-0d16642075b1 +Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.consumption +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.Consumption Module +## Description +Microsoft Azure PowerShell: Consumption cmdlets + +## Az.Consumption Cmdlets +### [Get-AzConsumptionAggregatedCost](Get-AzConsumptionAggregatedCost.md) +Provides the aggregate cost of a management group and all child management groups by current billing period. + +### [Get-AzConsumptionBalance](Get-AzConsumptionBalance.md) +Gets the balances for a scope by billingAccountId. +Balances are available via this API only for May 1, 2014 or later. + +### [Get-AzConsumptionBudget](Get-AzConsumptionBudget.md) +Gets the budget for the scope by budget name. + +### [Get-AzConsumptionCharge](Get-AzConsumptionCharge.md) +Lists the charges based for the defined scope. + +### [Get-AzConsumptionCredit](Get-AzConsumptionCredit.md) +The credit summary by billingAccountId and billingProfileId. + +### [Get-AzConsumptionEvent](Get-AzConsumptionEvent.md) +Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing profile for a given start and end date. + +### [Get-AzConsumptionLot](Get-AzConsumptionLot.md) +Lists all Azure credits for a billing account or a billing profile. +The API is only supported for Microsoft Customer Agreements (MCA) billing accounts. + +### [Get-AzConsumptionMarketplace](Get-AzConsumptionMarketplace.md) +Lists the marketplaces for a scope at the defined scope. +Marketplaces are available via this API only for May 1, 2014 or later. + +### [Get-AzConsumptionPriceSheet](Get-AzConsumptionPriceSheet.md) +Gets the price sheet for a subscription. +Price sheet is available via this API only for May 1, 2014 or later. + +### [Get-AzConsumptionReservationDetail](Get-AzConsumptionReservationDetail.md) +Lists the reservations details for provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. + +### [Get-AzConsumptionReservationRecommendation](Get-AzConsumptionReservationRecommendation.md) +List of recommendations for purchasing reserved instances. + +### [Get-AzConsumptionReservationRecommendationDetail](Get-AzConsumptionReservationRecommendationDetail.md) +Details of a reservation recommendation for what-if analysis of reserved instances. + +### [Get-AzConsumptionReservationsDetail](Get-AzConsumptionReservationsDetail.md) +Lists the reservations details for the defined scope and provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. + +### [Get-AzConsumptionReservationsSummary](Get-AzConsumptionReservationsSummary.md) +Lists the reservations summaries for the defined scope daily or monthly grain. + +### [Get-AzConsumptionReservationSummary](Get-AzConsumptionReservationSummary.md) +Lists the reservations summaries for daily or monthly grain. + +### [Get-AzConsumptionReservationTransaction](Get-AzConsumptionReservationTransaction.md) +List of transactions for reserved instances on billing account scope. +Note: The refund transactions are posted along with its purchase transaction (i.e. +in the purchase billing month). +For example, The refund is requested in May 2021. +This refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made. + +### [Get-AzConsumptionTag](Get-AzConsumptionTag.md) +Get all available tag keys for the defined scope + +### [Get-AzConsumptionUsageDetail](Get-AzConsumptionUsageDetail.md) +Lists the usage details for the defined scope. +Usage details are available via this API only for May 1, 2014 or later. + +### [New-AzConsumptionBudget](New-AzConsumptionBudget.md) +The operation to create or update a budget. +You can optionally provide an eTag if desired as a form of concurrency control. +To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. + +### [Remove-AzConsumptionBudget](Remove-AzConsumptionBudget.md) +The operation to delete a budget. + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionAggregatedCost.md b/swaggerci/consumption/docs/Get-AzConsumptionAggregatedCost.md new file mode 100644 index 000000000000..1f91161e7151 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionAggregatedCost.md @@ -0,0 +1,182 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionaggregatedcost +schema: 2.0.0 +--- + +# Get-AzConsumptionAggregatedCost + +## SYNOPSIS +Provides the aggregate cost of a management group and all child management groups by current billing period. + +## SYNTAX + +### Get (Default) +``` +Get-AzConsumptionAggregatedCost -ManagementGroupId [-Filter ] [-DefaultProfile ] + [] +``` + +### Get1 +``` +Get-AzConsumptionAggregatedCost -BillingPeriodName -ManagementGroupId + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzConsumptionAggregatedCost -InputObject [-Filter ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity1 +``` +Get-AzConsumptionAggregatedCost -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Provides the aggregate cost of a management group and all child management groups by current billing period. + +## 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 + +### -BillingPeriodName +Billing Period Name. + +```yaml +Type: System.String +Parameter Sets: Get1 +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 +``` + +### -Filter +May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). +The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. +It does not currently support 'ne', 'or', or 'not'. +Tag filter is a key value pair string where key and value is separated by a colon (:). + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentity +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.Consumption.Models.IConsumptionIdentity +Parameter Sets: GetViaIdentity, GetViaIdentity1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagementGroupId +Azure Management Group ID. + +```yaml +Type: System.String +Parameter Sets: Get, Get1 +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.Consumption.Models.IConsumptionIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + +## 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 + - `[BillingAccountId ]`: BillingAccount ID + - `[BillingPeriodName ]`: Billing Period Name. + - `[BillingProfileId ]`: Azure Billing Profile ID. + - `[BudgetName ]`: Budget Name. + - `[CustomerId ]`: Customer ID + - `[Id ]`: Resource identity path + - `[ManagementGroupId ]`: Azure Management Group ID. + - `[ReservationId ]`: Id of the reservation + - `[ReservationOrderId ]`: Order Id of the reservation + - `[ResourceScope ]`: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + - `[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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + - `[SubscriptionId ]`: Azure Subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionBalance.md b/swaggerci/consumption/docs/Get-AzConsumptionBalance.md new file mode 100644 index 000000000000..9201a72c22c3 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionBalance.md @@ -0,0 +1,163 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionbalance +schema: 2.0.0 +--- + +# Get-AzConsumptionBalance + +## SYNOPSIS +Gets the balances for a scope by billingAccountId. +Balances are available via this API only for May 1, 2014 or later. + +## SYNTAX + +### Get (Default) +``` +Get-AzConsumptionBalance -BillingAccountId [-DefaultProfile ] [] +``` + +### Get1 +``` +Get-AzConsumptionBalance -BillingAccountId -BillingPeriodName [-DefaultProfile ] + [] +``` + +### GetViaIdentity +``` +Get-AzConsumptionBalance -InputObject [-DefaultProfile ] [] +``` + +### GetViaIdentity1 +``` +Get-AzConsumptionBalance -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the balances for a scope by billingAccountId. +Balances are available via this API only for May 1, 2014 or later. + +## 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 + +### -BillingAccountId +BillingAccount ID + +```yaml +Type: System.String +Parameter Sets: Get, Get1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BillingPeriodName +Billing Period Name. + +```yaml +Type: System.String +Parameter Sets: Get1 +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 +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +Parameter Sets: GetViaIdentity, GetViaIdentity1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +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.Consumption.Models.IConsumptionIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance + +## 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 + - `[BillingAccountId ]`: BillingAccount ID + - `[BillingPeriodName ]`: Billing Period Name. + - `[BillingProfileId ]`: Azure Billing Profile ID. + - `[BudgetName ]`: Budget Name. + - `[CustomerId ]`: Customer ID + - `[Id ]`: Resource identity path + - `[ManagementGroupId ]`: Azure Management Group ID. + - `[ReservationId ]`: Id of the reservation + - `[ReservationOrderId ]`: Order Id of the reservation + - `[ResourceScope ]`: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + - `[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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + - `[SubscriptionId ]`: Azure Subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionBudget.md b/swaggerci/consumption/docs/Get-AzConsumptionBudget.md new file mode 100644 index 000000000000..8d3098921a06 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionBudget.md @@ -0,0 +1,156 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionbudget +schema: 2.0.0 +--- + +# Get-AzConsumptionBudget + +## SYNOPSIS +Gets the budget for the scope by budget name. + +## SYNTAX + +### List (Default) +``` +Get-AzConsumptionBudget -Scope [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzConsumptionBudget -Name -Scope [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzConsumptionBudget -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the budget for the scope by budget 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.Consumption.Models.IConsumptionIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Budget Name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: BudgetName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. + +```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.Consumption.Models.IConsumptionIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget + +## 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 + - `[BillingAccountId ]`: BillingAccount ID + - `[BillingPeriodName ]`: Billing Period Name. + - `[BillingProfileId ]`: Azure Billing Profile ID. + - `[BudgetName ]`: Budget Name. + - `[CustomerId ]`: Customer ID + - `[Id ]`: Resource identity path + - `[ManagementGroupId ]`: Azure Management Group ID. + - `[ReservationId ]`: Id of the reservation + - `[ReservationOrderId ]`: Order Id of the reservation + - `[ResourceScope ]`: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + - `[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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + - `[SubscriptionId ]`: Azure Subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionCharge.md b/swaggerci/consumption/docs/Get-AzConsumptionCharge.md new file mode 100644 index 000000000000..8d17fc15ab1f --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionCharge.md @@ -0,0 +1,161 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptioncharge +schema: 2.0.0 +--- + +# Get-AzConsumptionCharge + +## SYNOPSIS +Lists the charges based for the defined scope. + +## SYNTAX + +``` +Get-AzConsumptionCharge -Scope [-Apply ] [-EndDate ] [-Filter ] + [-StartDate ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Lists the charges based for 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 + +### -Apply +May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. + +```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 +``` + +### -EndDate +End date + +```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 charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). +The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. +It does not currently support 'ne', 'or', or 'not'. +Tag filter is a key value pair string where key and value is separated by a colon (:). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scope associated with charges operations. +This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. +For department and enrollment accounts, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. +For e.g. +to specify billing period at department scope use '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. +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 +``` + +### -StartDate +Start date + +```yaml +Type: System.String +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.Consumption.Models.Api20211001.IChargeSummary + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionCredit.md b/swaggerci/consumption/docs/Get-AzConsumptionCredit.md new file mode 100644 index 000000000000..116ae326dfed --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionCredit.md @@ -0,0 +1,167 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptioncredit +schema: 2.0.0 +--- + +# Get-AzConsumptionCredit + +## SYNOPSIS +The credit summary by billingAccountId and billingProfileId. + +## SYNTAX + +### Get (Default) +``` +Get-AzConsumptionCredit -BillingAccountId -BillingProfileId [-DefaultProfile ] + [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzConsumptionCredit -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +The credit summary by billingAccountId and billingProfileId. + +## 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 + +### -BillingAccountId +BillingAccount ID + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BillingProfileId +Azure Billing Profile ID. + +```yaml +Type: System.String +Parameter Sets: Get +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 +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +Parameter Sets: GetViaIdentity +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 +``` + +### 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.Consumption.Models.IConsumptionIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary + +## 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 + - `[BillingAccountId ]`: BillingAccount ID + - `[BillingPeriodName ]`: Billing Period Name. + - `[BillingProfileId ]`: Azure Billing Profile ID. + - `[BudgetName ]`: Budget Name. + - `[CustomerId ]`: Customer ID + - `[Id ]`: Resource identity path + - `[ManagementGroupId ]`: Azure Management Group ID. + - `[ReservationId ]`: Id of the reservation + - `[ReservationOrderId ]`: Order Id of the reservation + - `[ResourceScope ]`: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + - `[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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + - `[SubscriptionId ]`: Azure Subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionEvent.md b/swaggerci/consumption/docs/Get-AzConsumptionEvent.md new file mode 100644 index 000000000000..f4ecda2b4cd3 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionEvent.md @@ -0,0 +1,163 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionevent +schema: 2.0.0 +--- + +# Get-AzConsumptionEvent + +## SYNOPSIS +Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing profile for a given start and end date. + +## SYNTAX + +### List1 (Default) +``` +Get-AzConsumptionEvent -BillingAccountId [-Filter ] [-DefaultProfile ] + [] +``` + +### List +``` +Get-AzConsumptionEvent -BillingAccountId -BillingProfileId -EndDate + -StartDate [-DefaultProfile ] [] +``` + +## DESCRIPTION +Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing profile for a given start and end date. + +## 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 + +### -BillingAccountId +BillingAccount ID + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BillingProfileId +Azure Billing Profile ID. + +```yaml +Type: System.String +Parameter Sets: List +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: List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +May be used to filter the events by lotId, lotSource etc. +The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. +It does not currently support 'ne', 'or', or 'not'. +Tag filter is a key value pair string where key and value is separated by a colon (:). + +```yaml +Type: System.String +Parameter Sets: List1 +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: 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 + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionLot.md b/swaggerci/consumption/docs/Get-AzConsumptionLot.md new file mode 100644 index 000000000000..fa46eb007568 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionLot.md @@ -0,0 +1,156 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionlot +schema: 2.0.0 +--- + +# Get-AzConsumptionLot + +## SYNOPSIS +Lists all Azure credits for a billing account or a billing profile. +The API is only supported for Microsoft Customer Agreements (MCA) billing accounts. + +## SYNTAX + +### List1 (Default) +``` +Get-AzConsumptionLot -BillingAccountId [-Filter ] [-DefaultProfile ] + [] +``` + +### List +``` +Get-AzConsumptionLot -BillingAccountId -BillingProfileId [-DefaultProfile ] + [] +``` + +### List2 +``` +Get-AzConsumptionLot -BillingAccountId -CustomerId [-Filter ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Lists all Azure credits for a billing account or a billing profile. +The API is only supported for Microsoft Customer Agreements (MCA) billing accounts. + +## 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 + +### -BillingAccountId +BillingAccount ID + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BillingProfileId +Azure Billing Profile ID. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CustomerId +Customer ID + +```yaml +Type: System.String +Parameter Sets: List2 +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 +``` + +### -Filter +May be used to filter the lots by Status, Source etc. +The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. +It does not currently support 'ne', 'or', or 'not'. +Tag filter is a key value pair string where key and value is separated by a colon (:). + +```yaml +Type: System.String +Parameter Sets: List1, List2 +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.Consumption.Models.Api20211001.ILotSummary + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionMarketplace.md b/swaggerci/consumption/docs/Get-AzConsumptionMarketplace.md new file mode 100644 index 000000000000..5ffa3e77fb12 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionMarketplace.md @@ -0,0 +1,162 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionmarketplace +schema: 2.0.0 +--- + +# Get-AzConsumptionMarketplace + +## SYNOPSIS +Lists the marketplaces for a scope at the defined scope. +Marketplaces are available via this API only for May 1, 2014 or later. + +## SYNTAX + +``` +Get-AzConsumptionMarketplace -Scope [-Filter ] [-Skiptoken ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Lists the marketplaces for a scope at the defined scope. +Marketplaces are available via this API only for May 1, 2014 or later. + +## 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 +``` + +### -Filter +May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. +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 +``` + +### -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 marketplace 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. +For subscription, billing account, department, enrollment account and ManagementGroup, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. +For e.g. +to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + +```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 marketplaces. + +```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.Consumption.Models.Api20211001.IMarketplace + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionPriceSheet.md b/swaggerci/consumption/docs/Get-AzConsumptionPriceSheet.md new file mode 100644 index 000000000000..38bec5d1f8a8 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionPriceSheet.md @@ -0,0 +1,213 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionpricesheet +schema: 2.0.0 +--- + +# Get-AzConsumptionPriceSheet + +## SYNOPSIS +Gets the price sheet for a subscription. +Price sheet is available via this API only for May 1, 2014 or later. + +## SYNTAX + +### Get (Default) +``` +Get-AzConsumptionPriceSheet [-SubscriptionId ] [-Expand ] [-Skiptoken ] + [-Top ] [-DefaultProfile ] [] +``` + +### Get1 +``` +Get-AzConsumptionPriceSheet -BillingPeriodName [-SubscriptionId ] [-Expand ] + [-Skiptoken ] [-Top ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzConsumptionPriceSheet -InputObject [-Expand ] [-Skiptoken ] + [-Top ] [-DefaultProfile ] [] +``` + +### GetViaIdentity1 +``` +Get-AzConsumptionPriceSheet -InputObject [-Expand ] [-Skiptoken ] + [-Top ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the price sheet for a subscription. +Price sheet is available via this API only for May 1, 2014 or later. + +## 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 + +### -BillingPeriodName +Billing Period Name. + +```yaml +Type: System.String +Parameter Sets: Get1 +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 +``` + +### -Expand +May be used to expand the properties/meterDetails within a price sheet. +By default, these fields are not included when returning price sheet. + +```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.Consumption.Models.IConsumptionIdentity +Parameter Sets: GetViaIdentity, GetViaIdentity1 +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 +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String[] +Parameter Sets: Get, Get1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +May be used to limit the number of results to the top N results. + +```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.Consumption.Models.IConsumptionIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult + +## 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 + - `[BillingAccountId ]`: BillingAccount ID + - `[BillingPeriodName ]`: Billing Period Name. + - `[BillingProfileId ]`: Azure Billing Profile ID. + - `[BudgetName ]`: Budget Name. + - `[CustomerId ]`: Customer ID + - `[Id ]`: Resource identity path + - `[ManagementGroupId ]`: Azure Management Group ID. + - `[ReservationId ]`: Id of the reservation + - `[ReservationOrderId ]`: Order Id of the reservation + - `[ResourceScope ]`: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + - `[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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + - `[SubscriptionId ]`: Azure Subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionReservationDetail.md b/swaggerci/consumption/docs/Get-AzConsumptionReservationDetail.md new file mode 100644 index 000000000000..900f5164d9d5 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionReservationDetail.md @@ -0,0 +1,136 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationdetail +schema: 2.0.0 +--- + +# Get-AzConsumptionReservationDetail + +## SYNOPSIS +Lists the reservations details for provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. + +## SYNTAX + +### List (Default) +``` +Get-AzConsumptionReservationDetail -ReservationOrderId -Filter [-DefaultProfile ] + [] +``` + +### List1 +``` +Get-AzConsumptionReservationDetail -ReservationId -ReservationOrderId -Filter + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Lists the reservations details for provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. + +## 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 +``` + +### -Filter +Filter reservation details by date range. +The properties/UsageDate for start date and end date. +The filter supports 'le' and 'ge' + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ReservationId +Id of the reservation + +```yaml +Type: System.String +Parameter Sets: List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ReservationOrderId +Order Id of the reservation + +```yaml +Type: System.String +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.Consumption.Models.Api20211001.IReservationDetail + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionReservationRecommendation.md b/swaggerci/consumption/docs/Get-AzConsumptionReservationRecommendation.md new file mode 100644 index 000000000000..e22c781e972e --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionReservationRecommendation.md @@ -0,0 +1,124 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationrecommendation +schema: 2.0.0 +--- + +# Get-AzConsumptionReservationRecommendation + +## SYNOPSIS +List of recommendations for purchasing reserved instances. + +## SYNTAX + +``` +Get-AzConsumptionReservationRecommendation -ResourceScope [-Filter ] + [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +List of recommendations for purchasing reserved instances. + +## 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 +``` + +### -Filter +May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + +```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 +``` + +### -ResourceScope +The scope associated with reservation recommendations operations. +This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope + +```yaml +Type: System.String +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.Consumption.Models.Api20211001.IReservationRecommendation + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionReservationRecommendationDetail.md b/swaggerci/consumption/docs/Get-AzConsumptionReservationRecommendationDetail.md new file mode 100644 index 000000000000..527035d1e68a --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionReservationRecommendationDetail.md @@ -0,0 +1,231 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationrecommendationdetail +schema: 2.0.0 +--- + +# Get-AzConsumptionReservationRecommendationDetail + +## SYNOPSIS +Details of a reservation recommendation for what-if analysis of reserved instances. + +## SYNTAX + +### Get (Default) +``` +Get-AzConsumptionReservationRecommendationDetail -ResourceScope -LookBackPeriod + -Product -Region -Scope -Term [-DefaultProfile ] [-PassThru] + [] +``` + +### GetViaIdentity +``` +Get-AzConsumptionReservationRecommendationDetail -InputObject + -LookBackPeriod -Product -Region -Scope -Term + [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Details of a reservation recommendation for what-if analysis of reserved instances. + +## 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.Consumption.Models.IConsumptionIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LookBackPeriod +Filter the time period on which reservation recommendation results are based. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod +Parameter Sets: (All) +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 +``` + +### -Product +Filter the products for which reservation recommendation results are generated. +Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks) + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Region +Used to select the region the recommendation should be generated for. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceScope +The scope associated with reservation recommendation details operations. +This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +Scope of the reservation. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Term +Specify length of reservation recommendation term. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term +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 + +### Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel + +## 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 + - `[BillingAccountId ]`: BillingAccount ID + - `[BillingPeriodName ]`: Billing Period Name. + - `[BillingProfileId ]`: Azure Billing Profile ID. + - `[BudgetName ]`: Budget Name. + - `[CustomerId ]`: Customer ID + - `[Id ]`: Resource identity path + - `[ManagementGroupId ]`: Azure Management Group ID. + - `[ReservationId ]`: Id of the reservation + - `[ReservationOrderId ]`: Order Id of the reservation + - `[ResourceScope ]`: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + - `[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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + - `[SubscriptionId ]`: Azure Subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionReservationSummary.md b/swaggerci/consumption/docs/Get-AzConsumptionReservationSummary.md new file mode 100644 index 000000000000..70df6861c864 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionReservationSummary.md @@ -0,0 +1,147 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationsummary +schema: 2.0.0 +--- + +# Get-AzConsumptionReservationSummary + +## SYNOPSIS +Lists the reservations summaries for daily or monthly grain. + +## SYNTAX + +### List (Default) +``` +Get-AzConsumptionReservationSummary -ReservationOrderId -Grain [-Filter ] + [-DefaultProfile ] [] +``` + +### List1 +``` +Get-AzConsumptionReservationSummary -ReservationId -ReservationOrderId -Grain + [-Filter ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Lists the reservations summaries for daily or monthly grain. + +## 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 +``` + +### -Filter +Required only for daily grain. +The properties/UsageDate for start date and end date. +The filter supports 'le' and 'ge' + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Grain +Can be daily or monthly + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ReservationId +Id of the reservation + +```yaml +Type: System.String +Parameter Sets: List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ReservationOrderId +Order Id of the reservation + +```yaml +Type: System.String +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.Consumption.Models.Api20211001.IReservationSummary + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionReservationTransaction.md b/swaggerci/consumption/docs/Get-AzConsumptionReservationTransaction.md new file mode 100644 index 000000000000..719ae30e5f24 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionReservationTransaction.md @@ -0,0 +1,145 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationtransaction +schema: 2.0.0 +--- + +# Get-AzConsumptionReservationTransaction + +## SYNOPSIS +List of transactions for reserved instances on billing account scope. +Note: The refund transactions are posted along with its purchase transaction (i.e. +in the purchase billing month). +For example, The refund is requested in May 2021. +This refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made. + +## SYNTAX + +### List (Default) +``` +Get-AzConsumptionReservationTransaction -BillingAccountId [-Filter ] + [-DefaultProfile ] [] +``` + +### List1 +``` +Get-AzConsumptionReservationTransaction -BillingAccountId -BillingProfileId + [-Filter ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +List of transactions for reserved instances on billing account scope. +Note: The refund transactions are posted along with its purchase transaction (i.e. +in the purchase billing month). +For example, The refund is requested in May 2021. +This refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made. + +## 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 + +### -BillingAccountId +BillingAccount ID + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BillingProfileId +Azure Billing Profile ID. + +```yaml +Type: System.String +Parameter Sets: List1 +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 +``` + +### -Filter +Filter reservation transactions by date range. +The properties/EventDate for start date and end date. +The filter supports 'le' and 'ge'. +Note: API returns data for the entire start date's and end date's billing month. +For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for the entire December 2020 month (i.e. +will contain records for dates December 30 and 31) + +```yaml +Type: System.String +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.Consumption.Models.Api20211001.IModernReservationTransaction + +### Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionReservationsDetail.md b/swaggerci/consumption/docs/Get-AzConsumptionReservationsDetail.md new file mode 100644 index 000000000000..d4104bafdc84 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionReservationsDetail.md @@ -0,0 +1,183 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationsdetail +schema: 2.0.0 +--- + +# Get-AzConsumptionReservationsDetail + +## SYNOPSIS +Lists the reservations details for the defined scope and provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. + +## SYNTAX + +``` +Get-AzConsumptionReservationsDetail -ResourceScope [-EndDate ] [-Filter ] + [-ReservationId ] [-ReservationOrderId ] [-StartDate ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Lists the reservations details for the defined scope and provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. + +## 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 +``` + +### -EndDate +End date. +Only applicable when querying with billing profile + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +Filter reservation details by date range. +The properties/UsageDate for start date and end date. +The filter supports 'le' and 'ge'. +Not applicable when querying with billing profile + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ReservationId +Reservation Id GUID. +Only valid if reservationOrderId is also provided. +Filter to a specific reservation + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ReservationOrderId +Reservation Order Id GUID. +Required if reservationId is provided. +Filter to a specific reservation order + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceScope +The scope associated with reservations details operations. +This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StartDate +Start date. +Only applicable when querying with billing profile + +```yaml +Type: System.String +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.Consumption.Models.Api20211001.IReservationDetail + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionReservationsSummary.md b/swaggerci/consumption/docs/Get-AzConsumptionReservationsSummary.md new file mode 100644 index 000000000000..39e9caa50714 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionReservationsSummary.md @@ -0,0 +1,194 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationssummary +schema: 2.0.0 +--- + +# Get-AzConsumptionReservationsSummary + +## SYNOPSIS +Lists the reservations summaries for the defined scope daily or monthly grain. + +## SYNTAX + +``` +Get-AzConsumptionReservationsSummary -ResourceScope -Grain [-EndDate ] + [-Filter ] [-ReservationId ] [-ReservationOrderId ] [-StartDate ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Lists the reservations summaries for the defined scope daily or monthly grain. + +## 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 +``` + +### -EndDate +End date. +Only applicable when querying with billing profile + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +Required only for daily grain. +The properties/UsageDate for start date and end date. +The filter supports 'le' and 'ge'. +Not applicable when querying with billing profile + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Grain +Can be daily or monthly + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ReservationId +Reservation Id GUID. +Only valid if reservationOrderId is also provided. +Filter to a specific reservation + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ReservationOrderId +Reservation Order Id GUID. +Required if reservationId is provided. +Filter to a specific reservation order + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceScope +The scope associated with reservations summaries operations. +This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StartDate +Start date. +Only applicable when querying with billing profile + +```yaml +Type: System.String +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.Consumption.Models.Api20211001.IReservationSummary + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionTag.md b/swaggerci/consumption/docs/Get-AzConsumptionTag.md new file mode 100644 index 000000000000..ddc9df625fb3 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionTag.md @@ -0,0 +1,152 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptiontag +schema: 2.0.0 +--- + +# Get-AzConsumptionTag + +## SYNOPSIS +Get all available tag keys for the defined scope + +## SYNTAX + +### Get (Default) +``` +Get-AzConsumptionTag -Scope [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzConsumptionTag -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +Get all available tag keys for 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 +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +Parameter Sets: GetViaIdentity +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 tags 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope.. + +```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.Consumption.Models.IConsumptionIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult + +## 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 + - `[BillingAccountId ]`: BillingAccount ID + - `[BillingPeriodName ]`: Billing Period Name. + - `[BillingProfileId ]`: Azure Billing Profile ID. + - `[BudgetName ]`: Budget Name. + - `[CustomerId ]`: Customer ID + - `[Id ]`: Resource identity path + - `[ManagementGroupId ]`: Azure Management Group ID. + - `[ReservationId ]`: Id of the reservation + - `[ReservationOrderId ]`: Order Id of the reservation + - `[ResourceScope ]`: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + - `[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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + - `[SubscriptionId ]`: Azure Subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/Get-AzConsumptionUsageDetail.md b/swaggerci/consumption/docs/Get-AzConsumptionUsageDetail.md new file mode 100644 index 000000000000..5b756421f259 --- /dev/null +++ b/swaggerci/consumption/docs/Get-AzConsumptionUsageDetail.md @@ -0,0 +1,196 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionusagedetail +schema: 2.0.0 +--- + +# Get-AzConsumptionUsageDetail + +## SYNOPSIS +Lists the usage details for the defined scope. +Usage details are available via this API only for May 1, 2014 or later. + +## SYNTAX + +``` +Get-AzConsumptionUsageDetail -Scope [-Expand ] [-Filter ] [-Metric ] + [-Skiptoken ] [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Lists the usage details for the defined scope. +Usage details are available via this API only for May 1, 2014 or later. + +## 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/additionalInfo or properties/meterDetails within a list of usage details. +By default, these fields are not included when listing usage details. + +```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 usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. +The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. +It does not currently support 'ne', 'or', or 'not'. +Tag filter is a key value pair string where key and value is separated by a colon (:). +PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Metric +Allows to select different type of cost/usage records. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype +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 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. +For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. +For e.g. +to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. +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 +``` + +### -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 usageDetails. + +```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.Consumption.Models.Api20211001.IUsageDetail + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/New-AzConsumptionBudget.md b/swaggerci/consumption/docs/New-AzConsumptionBudget.md new file mode 100644 index 000000000000..071683f64dab --- /dev/null +++ b/swaggerci/consumption/docs/New-AzConsumptionBudget.md @@ -0,0 +1,330 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/new-azconsumptionbudget +schema: 2.0.0 +--- + +# New-AzConsumptionBudget + +## SYNOPSIS +The operation to create or update a budget. +You can optionally provide an eTag if desired as a form of concurrency control. +To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. + +## SYNTAX + +``` +New-AzConsumptionBudget -Name -Scope [-Amount ] [-DimensionName ] + [-DimensionValue ] [-ETag ] [-FilterAnd ] + [-Notification ] [-TagName ] [-TagValue ] [-TimeGrain ] + [-TimePeriodEndDate ] [-TimePeriodStartDate ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +The operation to create or update a budget. +You can optionally provide an eTag if desired as a form of concurrency control. +To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. + +## 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 + +### -Amount +The total amount of cost to track with the budget + +```yaml +Type: System.Decimal +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 +``` + +### -DimensionName +The name of the column to use in comparison. + +```yaml +Type: System.String +Parameter Sets: (All) +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: (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 +``` + +### -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.Consumption.Models.Api20211001.IBudgetFilterProperties[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Budget Name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: BudgetName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Notification +Dictionary of notifications associated with the budget. +Budget can have up to five notifications. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. + +```yaml +Type: System.String +Parameter Sets: (All) +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: (All) +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: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeGrain +The time covered by a budget. +Tracking of the amount will be reset based on the time grain. +BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodEndDate +The end date for the budget. +If not provided, we default this to 10 years from the start date. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodStartDate +The start date for the budget. + +```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.Consumption.Models.Api20211001.IBudget + +## 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. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + +## RELATED LINKS + diff --git a/swaggerci/consumption/docs/README.md b/swaggerci/consumption/docs/README.md new file mode 100644 index 000000000000..04d5d2b94432 --- /dev/null +++ b/swaggerci/consumption/docs/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.Consumption` 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.Consumption` 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/consumption/docs/Remove-AzConsumptionBudget.md b/swaggerci/consumption/docs/Remove-AzConsumptionBudget.md new file mode 100644 index 000000000000..74ac77b163ac --- /dev/null +++ b/swaggerci/consumption/docs/Remove-AzConsumptionBudget.md @@ -0,0 +1,199 @@ +--- +external help file: +Module Name: Az.Consumption +online version: https://docs.microsoft.com/en-us/powershell/module/az.consumption/remove-azconsumptionbudget +schema: 2.0.0 +--- + +# Remove-AzConsumptionBudget + +## SYNOPSIS +The operation to delete a budget. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzConsumptionBudget -Name -Scope [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzConsumptionBudget -InputObject [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The operation to delete a budget. + +## 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.Consumption.Models.IConsumptionIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Budget Name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: BudgetName + +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 budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. + +```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.Consumption.Models.IConsumptionIdentity + +## 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 + - `[BillingAccountId ]`: BillingAccount ID + - `[BillingPeriodName ]`: Billing Period Name. + - `[BillingProfileId ]`: Azure Billing Profile ID. + - `[BudgetName ]`: Budget Name. + - `[CustomerId ]`: Customer ID + - `[Id ]`: Resource identity path + - `[ManagementGroupId ]`: Azure Management Group ID. + - `[ReservationId ]`: Id of the reservation + - `[ReservationOrderId ]`: Order Id of the reservation + - `[ResourceScope ]`: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + - `[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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + - `[SubscriptionId ]`: Azure Subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/consumption/examples/Get-AzConsumptionAggregatedCost.md b/swaggerci/consumption/examples/Get-AzConsumptionAggregatedCost.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionAggregatedCost.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/consumption/examples/Get-AzConsumptionBalance.md b/swaggerci/consumption/examples/Get-AzConsumptionBalance.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionBalance.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/consumption/examples/Get-AzConsumptionBudget.md b/swaggerci/consumption/examples/Get-AzConsumptionBudget.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionBudget.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/consumption/examples/Get-AzConsumptionCharge.md b/swaggerci/consumption/examples/Get-AzConsumptionCharge.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionCharge.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/consumption/examples/Get-AzConsumptionCredit.md b/swaggerci/consumption/examples/Get-AzConsumptionCredit.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionCredit.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/consumption/examples/Get-AzConsumptionEvent.md b/swaggerci/consumption/examples/Get-AzConsumptionEvent.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionEvent.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/consumption/examples/Get-AzConsumptionLot.md b/swaggerci/consumption/examples/Get-AzConsumptionLot.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionLot.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/consumption/examples/Get-AzConsumptionMarketplace.md b/swaggerci/consumption/examples/Get-AzConsumptionMarketplace.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionMarketplace.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/consumption/examples/Get-AzConsumptionPriceSheet.md b/swaggerci/consumption/examples/Get-AzConsumptionPriceSheet.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionPriceSheet.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/consumption/examples/Get-AzConsumptionReservationDetail.md b/swaggerci/consumption/examples/Get-AzConsumptionReservationDetail.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionReservationDetail.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/consumption/examples/Get-AzConsumptionReservationRecommendation.md b/swaggerci/consumption/examples/Get-AzConsumptionReservationRecommendation.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionReservationRecommendation.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/consumption/examples/Get-AzConsumptionReservationRecommendationDetail.md b/swaggerci/consumption/examples/Get-AzConsumptionReservationRecommendationDetail.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionReservationRecommendationDetail.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/consumption/examples/Get-AzConsumptionReservationSummary.md b/swaggerci/consumption/examples/Get-AzConsumptionReservationSummary.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionReservationSummary.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/consumption/examples/Get-AzConsumptionReservationTransaction.md b/swaggerci/consumption/examples/Get-AzConsumptionReservationTransaction.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionReservationTransaction.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/consumption/examples/Get-AzConsumptionReservationsDetail.md b/swaggerci/consumption/examples/Get-AzConsumptionReservationsDetail.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionReservationsDetail.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/consumption/examples/Get-AzConsumptionReservationsSummary.md b/swaggerci/consumption/examples/Get-AzConsumptionReservationsSummary.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionReservationsSummary.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/consumption/examples/Get-AzConsumptionTag.md b/swaggerci/consumption/examples/Get-AzConsumptionTag.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionTag.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/consumption/examples/Get-AzConsumptionUsageDetail.md b/swaggerci/consumption/examples/Get-AzConsumptionUsageDetail.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Get-AzConsumptionUsageDetail.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/consumption/examples/New-AzConsumptionBudget.md b/swaggerci/consumption/examples/New-AzConsumptionBudget.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/New-AzConsumptionBudget.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/consumption/examples/Remove-AzConsumptionBudget.md b/swaggerci/consumption/examples/Remove-AzConsumptionBudget.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/consumption/examples/Remove-AzConsumptionBudget.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/consumption/export-surface.ps1 b/swaggerci/consumption/export-surface.ps1 new file mode 100644 index 000000000000..df43f34a1360 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} +$null = Import-Module -Name $dll + +$moduleName = 'Az.Consumption' +$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/consumption/exports/Get-AzConsumptionAggregatedCost.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionAggregatedCost.ps1 new file mode 100644 index 000000000000..ed83ca6c5dc5 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionAggregatedCost.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 +Provides the aggregate cost of a management group and all child management groups by current billing period. +.Description +Provides the aggregate cost of a management group and all child management groups by current billing period. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionaggregatedcost +#> +function Get-AzConsumptionAggregatedCost { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Azure Management Group ID. + ${ManagementGroupId}, + + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Billing Period Name. + ${BillingPeriodName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetViaIdentity')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). + # The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + # It does not currently support 'ne', 'or', or 'not'. + # Tag filter is a key value pair string where key and value is separated by a colon (:). + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionAggregatedCost_Get'; + Get1 = 'Az.Consumption.private\Get-AzConsumptionAggregatedCost_Get1'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionAggregatedCost_GetViaIdentity'; + GetViaIdentity1 = 'Az.Consumption.private\Get-AzConsumptionAggregatedCost_GetViaIdentity1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionBalance.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionBalance.ps1 new file mode 100644 index 000000000000..a03bb219880a --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionBalance.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 +Gets the balances for a scope by billingAccountId. +Balances are available via this API only for May 1, 2014 or later. +.Description +Gets the balances for a scope by billingAccountId. +Balances are available via this API only for May 1, 2014 or later. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionbalance +#> +function Get-AzConsumptionBalance { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # BillingAccount ID + ${BillingAccountId}, + + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Billing Period Name. + ${BillingPeriodName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # 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.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionBalance_Get'; + Get1 = 'Az.Consumption.private\Get-AzConsumptionBalance_Get1'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionBalance_GetViaIdentity'; + GetViaIdentity1 = 'Az.Consumption.private\Get-AzConsumptionBalance_GetViaIdentity1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionBudget.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionBudget.ps1 new file mode 100644 index 000000000000..d7f57e4fcce4 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionBudget.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 budget for the scope by budget name. +.Description +Gets the budget for the scope by budget name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionbudget +#> +function Get-AzConsumptionBudget { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('BudgetName')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Budget Name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # 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.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionBudget_Get'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionBudget_GetViaIdentity'; + List = 'Az.Consumption.private\Get-AzConsumptionBudget_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionCharge.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionCharge.ps1 new file mode 100644 index 000000000000..f7bbd2e560f1 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionCharge.ps1 @@ -0,0 +1,186 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 charges based for the defined scope. +.Description +Lists the charges based for the defined scope. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptioncharge +#> +function Get-AzConsumptionCharge { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with charges operations. + # This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. + # For department and enrollment accounts, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + # For e.g. + # to specify billing period at department scope use '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + # 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.Consumption.Category('Query')] + [System.String] + # May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. + ${Apply}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # End date + ${EndDate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). + # The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + # It does not currently support 'ne', 'or', or 'not'. + # Tag filter is a key value pair string where key and value is separated by a colon (:). + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Start date + ${StartDate}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionCharge_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionCredit.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionCredit.ps1 new file mode 100644 index 000000000000..4ed6f95b74a4 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionCredit.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 credit summary by billingAccountId and billingProfileId. +.Description +The credit summary by billingAccountId and billingProfileId. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptioncredit +#> +function Get-AzConsumptionCredit { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # BillingAccount ID + ${BillingAccountId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Azure Billing Profile ID. + ${BillingProfileId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # 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.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionCredit_Get'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionCredit_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionEvent.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionEvent.ps1 new file mode 100644 index 000000000000..e9976ce68557 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionEvent.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing profile for a given start and end date. +.Description +Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing profile for a given start and end date. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionevent +#> +function Get-AzConsumptionEvent { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # BillingAccount ID + ${BillingAccountId}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Azure Billing Profile ID. + ${BillingProfileId}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # End date + ${EndDate}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Start date + ${StartDate}, + + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter the events by lotId, lotSource etc. + # The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + # It does not currently support 'ne', 'or', or 'not'. + # Tag filter is a key value pair string where key and value is separated by a colon (:). + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionEvent_List'; + List1 = 'Az.Consumption.private\Get-AzConsumptionEvent_List1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionLot.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionLot.ps1 new file mode 100644 index 000000000000..7f1dac36b445 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionLot.ps1 @@ -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. +# 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 Azure credits for a billing account or a billing profile. +The API is only supported for Microsoft Customer Agreements (MCA) billing accounts. +.Description +Lists all Azure credits for a billing account or a billing profile. +The API is only supported for Microsoft Customer Agreements (MCA) billing accounts. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionlot +#> +function Get-AzConsumptionLot { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # BillingAccount ID + ${BillingAccountId}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Azure Billing Profile ID. + ${BillingProfileId}, + + [Parameter(ParameterSetName='List2', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Customer ID + ${CustomerId}, + + [Parameter(ParameterSetName='List1')] + [Parameter(ParameterSetName='List2')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter the lots by Status, Source etc. + # The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + # It does not currently support 'ne', 'or', or 'not'. + # Tag filter is a key value pair string where key and value is separated by a colon (:). + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionLot_List'; + List1 = 'Az.Consumption.private\Get-AzConsumptionLot_List1'; + List2 = 'Az.Consumption.private\Get-AzConsumptionLot_List2'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionMarketplace.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionMarketplace.ps1 new file mode 100644 index 000000000000..e87e91e37532 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionMarketplace.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 +Lists the marketplaces for a scope at the defined scope. +Marketplaces are available via this API only for May 1, 2014 or later. +.Description +Lists the marketplaces for a scope at the defined scope. +Marketplaces are available via this API only for May 1, 2014 or later. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionmarketplace +#> +function Get-AzConsumptionMarketplace { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with marketplace 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. + # For subscription, billing account, department, enrollment account and ManagementGroup, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + # For e.g. + # to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. + # The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + # It does not currently support 'ne', 'or', or 'not'. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category('Query')] + [System.Int32] + # May be used to limit the number of results to the most recent N marketplaces. + ${Top}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionMarketplace_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionPriceSheet.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionPriceSheet.ps1 new file mode 100644 index 000000000000..7ac882b82545 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionPriceSheet.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 +Gets the price sheet for a subscription. +Price sheet is available via this API only for May 1, 2014 or later. +.Description +Gets the price sheet for a subscription. +Price sheet is available via this API only for May 1, 2014 or later. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionpricesheet +#> +function Get-AzConsumptionPriceSheet { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='Get1')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Azure Subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Billing Period Name. + ${BillingPeriodName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to expand the properties/meterDetails within a price sheet. + # By default, these fields are not included when returning price sheet. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category('Query')] + [System.Int32] + # May be used to limit the number of results to the top N results. + ${Top}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionPriceSheet_Get'; + Get1 = 'Az.Consumption.private\Get-AzConsumptionPriceSheet_Get1'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionPriceSheet_GetViaIdentity'; + GetViaIdentity1 = 'Az.Consumption.private\Get-AzConsumptionPriceSheet_GetViaIdentity1'; + } + if (('Get', 'Get1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionReservationDetail.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionReservationDetail.ps1 new file mode 100644 index 000000000000..7c3d11bec0b8 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionReservationDetail.ps1 @@ -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. +# 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 reservations details for provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. +.Description +Lists the reservations details for provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationdetail +#> +function Get-AzConsumptionReservationDetail { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Order Id of the reservation + ${ReservationOrderId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Id of the reservation + ${ReservationId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Filter reservation details by date range. + # The properties/UsageDate for start date and end date. + # The filter supports 'le' and 'ge' + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationDetail_List'; + List1 = 'Az.Consumption.private\Get-AzConsumptionReservationDetail_List1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionReservationRecommendation.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionReservationRecommendation.ps1 new file mode 100644 index 000000000000..ebfc387b053b --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionReservationRecommendation.ps1 @@ -0,0 +1,167 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +List of recommendations for purchasing reserved instances. +.Description +List of recommendations for purchasing reserved instances. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationrecommendation +#> +function Get-AzConsumptionReservationRecommendation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with reservation recommendations operations. + # This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope + ${ResourceScope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationRecommendation_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionReservationRecommendationDetail.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionReservationRecommendationDetail.ps1 new file mode 100644 index 000000000000..69f4df5eb666 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionReservationRecommendationDetail.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 +Details of a reservation recommendation for what-if analysis of reserved instances. +.Description +Details of a reservation recommendation for what-if analysis of reserved instances. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationrecommendationdetail +#> +function Get-AzConsumptionReservationRecommendationDetail { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with reservation recommendation details operations. + # This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope + ${ResourceScope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod] + # Filter the time period on which reservation recommendation results are based. + ${LookBackPeriod}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Filter the products for which reservation recommendation results are generated. + # Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks) + ${Product}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Used to select the region the recommendation should be generated for. + ${Region}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope] + # Scope of the reservation. + ${Scope}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term] + # Specify length of reservation recommendation term. + ${Term}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationRecommendationDetail_Get'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionReservationRecommendationDetail_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionReservationSummary.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionReservationSummary.ps1 new file mode 100644 index 000000000000..9f444e9edcd8 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionReservationSummary.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the reservations summaries for daily or monthly grain. +.Description +Lists the reservations summaries for daily or monthly grain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationsummary +#> +function Get-AzConsumptionReservationSummary { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Order Id of the reservation + ${ReservationOrderId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Id of the reservation + ${ReservationId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain] + # Can be daily or monthly + ${Grain}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Required only for daily grain. + # The properties/UsageDate for start date and end date. + # The filter supports 'le' and 'ge' + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationSummary_List'; + List1 = 'Az.Consumption.private\Get-AzConsumptionReservationSummary_List1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionReservationTransaction.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionReservationTransaction.ps1 new file mode 100644 index 000000000000..f0c6dba0e232 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionReservationTransaction.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List of transactions for reserved instances on billing account scope. +Note: The refund transactions are posted along with its purchase transaction (i.e. +in the purchase billing month). +For example, The refund is requested in May 2021. +This refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made. +.Description +List of transactions for reserved instances on billing account scope. +Note: The refund transactions are posted along with its purchase transaction (i.e. +in the purchase billing month). +For example, The refund is requested in May 2021. +This refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationtransaction +#> +function Get-AzConsumptionReservationTransaction { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction], [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # BillingAccount ID + ${BillingAccountId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Azure Billing Profile ID. + ${BillingProfileId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Filter reservation transactions by date range. + # The properties/EventDate for start date and end date. + # The filter supports 'le' and 'ge'. + # Note: API returns data for the entire start date's and end date's billing month. + # For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for the entire December 2020 month (i.e. + # will contain records for dates December 30 and 31) + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationTransaction_List'; + List1 = 'Az.Consumption.private\Get-AzConsumptionReservationTransaction_List1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionReservationsDetail.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionReservationsDetail.ps1 new file mode 100644 index 000000000000..88915f6d4953 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionReservationsDetail.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 +Lists the reservations details for the defined scope and provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. +.Description +Lists the reservations details for the defined scope and provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationsdetail +#> +function Get-AzConsumptionReservationsDetail { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with reservations details operations. + # This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + ${ResourceScope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # End date. + # Only applicable when querying with billing profile + ${EndDate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Filter reservation details by date range. + # The properties/UsageDate for start date and end date. + # The filter supports 'le' and 'ge'. + # Not applicable when querying with billing profile + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Reservation Id GUID. + # Only valid if reservationOrderId is also provided. + # Filter to a specific reservation + ${ReservationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Reservation Order Id GUID. + # Required if reservationId is provided. + # Filter to a specific reservation order + ${ReservationOrderId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Start date. + # Only applicable when querying with billing profile + ${StartDate}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationsDetail_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionReservationsSummary.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionReservationsSummary.ps1 new file mode 100644 index 000000000000..40bd7f5f6099 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionReservationsSummary.ps1 @@ -0,0 +1,201 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 reservations summaries for the defined scope daily or monthly grain. +.Description +Lists the reservations summaries for the defined scope daily or monthly grain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationssummary +#> +function Get-AzConsumptionReservationsSummary { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with reservations summaries operations. + # This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + ${ResourceScope}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain] + # Can be daily or monthly + ${Grain}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # End date. + # Only applicable when querying with billing profile + ${EndDate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Required only for daily grain. + # The properties/UsageDate for start date and end date. + # The filter supports 'le' and 'ge'. + # Not applicable when querying with billing profile + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Reservation Id GUID. + # Only valid if reservationOrderId is also provided. + # Filter to a specific reservation + ${ReservationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Reservation Order Id GUID. + # Required if reservationId is provided. + # Filter to a specific reservation order + ${ReservationOrderId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Start date. + # Only applicable when querying with billing profile + ${StartDate}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationsSummary_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionTag.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionTag.ps1 new file mode 100644 index 000000000000..abe559d2e2bb --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionTag.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get all available tag keys for the defined scope +.Description +Get all available tag keys for the defined scope +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptiontag +#> +function Get-AzConsumptionTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with tags 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope.. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # 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.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionTag_Get'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionTag_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/Get-AzConsumptionUsageDetail.ps1 b/swaggerci/consumption/exports/Get-AzConsumptionUsageDetail.ps1 new file mode 100644 index 000000000000..e03124507e96 --- /dev/null +++ b/swaggerci/consumption/exports/Get-AzConsumptionUsageDetail.ps1 @@ -0,0 +1,204 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 usage details for the defined scope. +Usage details are available via this API only for May 1, 2014 or later. +.Description +Lists the usage details for the defined scope. +Usage details are available via this API only for May 1, 2014 or later. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionusagedetail +#> +function Get-AzConsumptionUsageDetail { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. + # For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + # For e.g. + # to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + # 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.Consumption.Category('Query')] + [System.String] + # May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. + # By default, these fields are not included when listing usage details. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. + # The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + # It does not currently support 'ne', 'or', or 'not'. + # Tag filter is a key value pair string where key and value is separated by a colon (:). + # PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type + ${Filter}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype] + # Allows to select different type of cost/usage records. + ${Metric}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category('Query')] + [System.Int32] + # May be used to limit the number of results to the most recent N usageDetails. + ${Top}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionUsageDetail_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/New-AzConsumptionBudget.ps1 b/swaggerci/consumption/exports/New-AzConsumptionBudget.ps1 new file mode 100644 index 000000000000..def1d7bd6991 --- /dev/null +++ b/swaggerci/consumption/exports/New-AzConsumptionBudget.ps1 @@ -0,0 +1,254 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 budget. +You can optionally provide an eTag if desired as a form of concurrency control. +To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. +.Description +The operation to create or update a budget. +You can optionally provide an eTag if desired as a form of concurrency control. +To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget +.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. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/new-azconsumptionbudget +#> +function New-AzConsumptionBudget { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('BudgetName')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Budget Name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.Decimal] + # The total amount of cost to track with the budget + ${Amount}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${DimensionName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${DimensionValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[]] + # 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()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications]))] + [System.Collections.Hashtable] + # Dictionary of notifications associated with the budget. + # Budget can have up to five notifications. + ${Notification}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${TagName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${TagValue}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType] + # The time covered by a budget. + # Tracking of the amount will be reset based on the time grain. + # BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers + ${TimeGrain}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.DateTime] + # The end date for the budget. + # If not provided, we default this to 10 years from the start date. + ${TimePeriodEndDate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.DateTime] + # The start date for the budget. + ${TimePeriodStartDate}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\New-AzConsumptionBudget_CreateExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/ProxyCmdletDefinitions.ps1 b/swaggerci/consumption/exports/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..01b0c5c44633 --- /dev/null +++ b/swaggerci/consumption/exports/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,3765 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +Provides the aggregate cost of a management group and all child management groups by current billing period. +.Description +Provides the aggregate cost of a management group and all child management groups by current billing period. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionaggregatedcost +#> +function Get-AzConsumptionAggregatedCost { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Azure Management Group ID. + ${ManagementGroupId}, + + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Billing Period Name. + ${BillingPeriodName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetViaIdentity')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). + # The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + # It does not currently support 'ne', 'or', or 'not'. + # Tag filter is a key value pair string where key and value is separated by a colon (:). + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionAggregatedCost_Get'; + Get1 = 'Az.Consumption.private\Get-AzConsumptionAggregatedCost_Get1'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionAggregatedCost_GetViaIdentity'; + GetViaIdentity1 = 'Az.Consumption.private\Get-AzConsumptionAggregatedCost_GetViaIdentity1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 balances for a scope by billingAccountId. +Balances are available via this API only for May 1, 2014 or later. +.Description +Gets the balances for a scope by billingAccountId. +Balances are available via this API only for May 1, 2014 or later. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionbalance +#> +function Get-AzConsumptionBalance { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # BillingAccount ID + ${BillingAccountId}, + + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Billing Period Name. + ${BillingPeriodName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # 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.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionBalance_Get'; + Get1 = 'Az.Consumption.private\Get-AzConsumptionBalance_Get1'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionBalance_GetViaIdentity'; + GetViaIdentity1 = 'Az.Consumption.private\Get-AzConsumptionBalance_GetViaIdentity1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 budget for the scope by budget name. +.Description +Gets the budget for the scope by budget name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionbudget +#> +function Get-AzConsumptionBudget { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('BudgetName')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Budget Name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # 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.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionBudget_Get'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionBudget_GetViaIdentity'; + List = 'Az.Consumption.private\Get-AzConsumptionBudget_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 charges based for the defined scope. +.Description +Lists the charges based for the defined scope. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptioncharge +#> +function Get-AzConsumptionCharge { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with charges operations. + # This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. + # For department and enrollment accounts, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + # For e.g. + # to specify billing period at department scope use '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + # 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.Consumption.Category('Query')] + [System.String] + # May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. + ${Apply}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # End date + ${EndDate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). + # The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + # It does not currently support 'ne', 'or', or 'not'. + # Tag filter is a key value pair string where key and value is separated by a colon (:). + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Start date + ${StartDate}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionCharge_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 credit summary by billingAccountId and billingProfileId. +.Description +The credit summary by billingAccountId and billingProfileId. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptioncredit +#> +function Get-AzConsumptionCredit { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # BillingAccount ID + ${BillingAccountId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Azure Billing Profile ID. + ${BillingProfileId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # 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.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionCredit_Get'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionCredit_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing profile for a given start and end date. +.Description +Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing profile for a given start and end date. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionevent +#> +function Get-AzConsumptionEvent { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # BillingAccount ID + ${BillingAccountId}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Azure Billing Profile ID. + ${BillingProfileId}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # End date + ${EndDate}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Start date + ${StartDate}, + + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter the events by lotId, lotSource etc. + # The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + # It does not currently support 'ne', 'or', or 'not'. + # Tag filter is a key value pair string where key and value is separated by a colon (:). + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionEvent_List'; + List1 = 'Az.Consumption.private\Get-AzConsumptionEvent_List1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 all Azure credits for a billing account or a billing profile. +The API is only supported for Microsoft Customer Agreements (MCA) billing accounts. +.Description +Lists all Azure credits for a billing account or a billing profile. +The API is only supported for Microsoft Customer Agreements (MCA) billing accounts. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionlot +#> +function Get-AzConsumptionLot { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # BillingAccount ID + ${BillingAccountId}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Azure Billing Profile ID. + ${BillingProfileId}, + + [Parameter(ParameterSetName='List2', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Customer ID + ${CustomerId}, + + [Parameter(ParameterSetName='List1')] + [Parameter(ParameterSetName='List2')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter the lots by Status, Source etc. + # The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + # It does not currently support 'ne', 'or', or 'not'. + # Tag filter is a key value pair string where key and value is separated by a colon (:). + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionLot_List'; + List1 = 'Az.Consumption.private\Get-AzConsumptionLot_List1'; + List2 = 'Az.Consumption.private\Get-AzConsumptionLot_List2'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 marketplaces for a scope at the defined scope. +Marketplaces are available via this API only for May 1, 2014 or later. +.Description +Lists the marketplaces for a scope at the defined scope. +Marketplaces are available via this API only for May 1, 2014 or later. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionmarketplace +#> +function Get-AzConsumptionMarketplace { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with marketplace 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. + # For subscription, billing account, department, enrollment account and ManagementGroup, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + # For e.g. + # to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. + # The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + # It does not currently support 'ne', 'or', or 'not'. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category('Query')] + [System.Int32] + # May be used to limit the number of results to the most recent N marketplaces. + ${Top}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionMarketplace_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 price sheet for a subscription. +Price sheet is available via this API only for May 1, 2014 or later. +.Description +Gets the price sheet for a subscription. +Price sheet is available via this API only for May 1, 2014 or later. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionpricesheet +#> +function Get-AzConsumptionPriceSheet { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='Get1')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Azure Subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Billing Period Name. + ${BillingPeriodName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to expand the properties/meterDetails within a price sheet. + # By default, these fields are not included when returning price sheet. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category('Query')] + [System.Int32] + # May be used to limit the number of results to the top N results. + ${Top}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionPriceSheet_Get'; + Get1 = 'Az.Consumption.private\Get-AzConsumptionPriceSheet_Get1'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionPriceSheet_GetViaIdentity'; + GetViaIdentity1 = 'Az.Consumption.private\Get-AzConsumptionPriceSheet_GetViaIdentity1'; + } + if (('Get', 'Get1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 reservations details for provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. +.Description +Lists the reservations details for provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationdetail +#> +function Get-AzConsumptionReservationDetail { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Order Id of the reservation + ${ReservationOrderId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Id of the reservation + ${ReservationId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Filter reservation details by date range. + # The properties/UsageDate for start date and end date. + # The filter supports 'le' and 'ge' + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationDetail_List'; + List1 = 'Az.Consumption.private\Get-AzConsumptionReservationDetail_List1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 +Details of a reservation recommendation for what-if analysis of reserved instances. +.Description +Details of a reservation recommendation for what-if analysis of reserved instances. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationrecommendationdetail +#> +function Get-AzConsumptionReservationRecommendationDetail { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with reservation recommendation details operations. + # This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope + ${ResourceScope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod] + # Filter the time period on which reservation recommendation results are based. + ${LookBackPeriod}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Filter the products for which reservation recommendation results are generated. + # Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks) + ${Product}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Used to select the region the recommendation should be generated for. + ${Region}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope] + # Scope of the reservation. + ${Scope}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term] + # Specify length of reservation recommendation term. + ${Term}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationRecommendationDetail_Get'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionReservationRecommendationDetail_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 +List of recommendations for purchasing reserved instances. +.Description +List of recommendations for purchasing reserved instances. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationrecommendation +#> +function Get-AzConsumptionReservationRecommendation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with reservation recommendations operations. + # This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope + ${ResourceScope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationRecommendation_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 reservations details for the defined scope and provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. +.Description +Lists the reservations details for the defined scope and provided date range. +Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. +In such cases, API call should be made with smaller date ranges. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationsdetail +#> +function Get-AzConsumptionReservationsDetail { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with reservations details operations. + # This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + ${ResourceScope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # End date. + # Only applicable when querying with billing profile + ${EndDate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Filter reservation details by date range. + # The properties/UsageDate for start date and end date. + # The filter supports 'le' and 'ge'. + # Not applicable when querying with billing profile + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Reservation Id GUID. + # Only valid if reservationOrderId is also provided. + # Filter to a specific reservation + ${ReservationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Reservation Order Id GUID. + # Required if reservationId is provided. + # Filter to a specific reservation order + ${ReservationOrderId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Start date. + # Only applicable when querying with billing profile + ${StartDate}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationsDetail_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 reservations summaries for the defined scope daily or monthly grain. +.Description +Lists the reservations summaries for the defined scope daily or monthly grain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationssummary +#> +function Get-AzConsumptionReservationsSummary { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with reservations summaries operations. + # This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + ${ResourceScope}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain] + # Can be daily or monthly + ${Grain}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # End date. + # Only applicable when querying with billing profile + ${EndDate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Required only for daily grain. + # The properties/UsageDate for start date and end date. + # The filter supports 'le' and 'ge'. + # Not applicable when querying with billing profile + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Reservation Id GUID. + # Only valid if reservationOrderId is also provided. + # Filter to a specific reservation + ${ReservationId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Reservation Order Id GUID. + # Required if reservationId is provided. + # Filter to a specific reservation order + ${ReservationOrderId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Start date. + # Only applicable when querying with billing profile + ${StartDate}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationsSummary_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 reservations summaries for daily or monthly grain. +.Description +Lists the reservations summaries for daily or monthly grain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationsummary +#> +function Get-AzConsumptionReservationSummary { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Order Id of the reservation + ${ReservationOrderId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Id of the reservation + ${ReservationId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain] + # Can be daily or monthly + ${Grain}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Required only for daily grain. + # The properties/UsageDate for start date and end date. + # The filter supports 'le' and 'ge' + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationSummary_List'; + List1 = 'Az.Consumption.private\Get-AzConsumptionReservationSummary_List1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 +List of transactions for reserved instances on billing account scope. +Note: The refund transactions are posted along with its purchase transaction (i.e. +in the purchase billing month). +For example, The refund is requested in May 2021. +This refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made. +.Description +List of transactions for reserved instances on billing account scope. +Note: The refund transactions are posted along with its purchase transaction (i.e. +in the purchase billing month). +For example, The refund is requested in May 2021. +This refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionreservationtransaction +#> +function Get-AzConsumptionReservationTransaction { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction], [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # BillingAccount ID + ${BillingAccountId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Azure Billing Profile ID. + ${BillingProfileId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # Filter reservation transactions by date range. + # The properties/EventDate for start date and end date. + # The filter supports 'le' and 'ge'. + # Note: API returns data for the entire start date's and end date's billing month. + # For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for the entire December 2020 month (i.e. + # will contain records for dates December 30 and 31) + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionReservationTransaction_List'; + List1 = 'Az.Consumption.private\Get-AzConsumptionReservationTransaction_List1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 all available tag keys for the defined scope +.Description +Get all available tag keys for the defined scope +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptiontag +#> +function Get-AzConsumptionTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with tags 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope.. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # 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.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionTag_Get'; + GetViaIdentity = 'Az.Consumption.private\Get-AzConsumptionTag_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 usage details for the defined scope. +Usage details are available via this API only for May 1, 2014 or later. +.Description +Lists the usage details for the defined scope. +Usage details are available via this API only for May 1, 2014 or later. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionusagedetail +#> +function Get-AzConsumptionUsageDetail { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. + # For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + # For e.g. + # to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + # 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.Consumption.Category('Query')] + [System.String] + # May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. + # By default, these fields are not included when listing usage details. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [System.String] + # May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. + # The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + # It does not currently support 'ne', 'or', or 'not'. + # Tag filter is a key value pair string where key and value is separated by a colon (:). + # PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type + ${Filter}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype] + # Allows to select different type of cost/usage records. + ${Metric}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category('Query')] + [System.Int32] + # May be used to limit the number of results to the most recent N usageDetails. + ${Top}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Get-AzConsumptionUsageDetail_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 budget. +You can optionally provide an eTag if desired as a form of concurrency control. +To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. +.Description +The operation to create or update a budget. +You can optionally provide an eTag if desired as a form of concurrency control. +To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget +.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. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/new-azconsumptionbudget +#> +function New-AzConsumptionBudget { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('BudgetName')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Budget Name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.Decimal] + # The total amount of cost to track with the budget + ${Amount}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${DimensionName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${DimensionValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[]] + # 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()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications]))] + [System.Collections.Hashtable] + # Dictionary of notifications associated with the budget. + # Budget can have up to five notifications. + ${Notification}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${TagName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${TagValue}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType])] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType] + # The time covered by a budget. + # Tracking of the amount will be reset based on the time grain. + # BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers + ${TimeGrain}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.DateTime] + # The end date for the budget. + # If not provided, we default this to 10 years from the start date. + ${TimePeriodEndDate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Body')] + [System.DateTime] + # The start date for the budget. + ${TimePeriodStartDate}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\New-AzConsumptionBudget_CreateExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 budget. +.Description +The operation to delete a budget. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/remove-azconsumptionbudget +#> +function Remove-AzConsumptionBudget { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('BudgetName')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Budget Name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. + ${Scope}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # 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.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Remove-AzConsumptionBudget_Delete'; + DeleteViaIdentity = 'Az.Consumption.private\Remove-AzConsumptionBudget_DeleteViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/exports/README.md b/swaggerci/consumption/exports/README.md new file mode 100644 index 000000000000..cf26e57de39c --- /dev/null +++ b/swaggerci/consumption/exports/README.md @@ -0,0 +1,20 @@ +# Exports +This directory contains the cmdlets *exported by* `Az.Consumption`. No other cmdlets in this repository are directly exported. What that means is the `Az.Consumption` 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.Consumption.private.dll`) and from the `../custom/Az.Consumption.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.Consumption.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/consumption/exports/Remove-AzConsumptionBudget.ps1 b/swaggerci/consumption/exports/Remove-AzConsumptionBudget.ps1 new file mode 100644 index 000000000000..4c86fbffaa54 --- /dev/null +++ b/swaggerci/consumption/exports/Remove-AzConsumptionBudget.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 +The operation to delete a budget. +.Description +The operation to delete a budget. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity +.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 + [BillingAccountId ]: BillingAccount ID + [BillingPeriodName ]: Billing Period Name. + [BillingProfileId ]: Azure Billing Profile ID. + [BudgetName ]: Budget Name. + [CustomerId ]: Customer ID + [Id ]: Resource identity path + [ManagementGroupId ]: Azure Management Group ID. + [ReservationId ]: Id of the reservation + [ReservationOrderId ]: Order Id of the reservation + [ResourceScope ]: The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). + [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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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. + [SubscriptionId ]: Azure Subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/remove-azconsumptionbudget +#> +function Remove-AzConsumptionBudget { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('BudgetName')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # Budget Name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [System.String] + # The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. + ${Scope}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity] + # 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.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.private\Remove-AzConsumptionBudget_Delete'; + DeleteViaIdentity = 'Az.Consumption.private\Remove-AzConsumptionBudget_DeleteViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generate-help.ps1 b/swaggerci/consumption/generate-help.ps1 new file mode 100644 index 000000000000..9d5e6a29a18b --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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.Consumption.private.dll') +$instance = [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/Module.cs b/swaggerci/consumption/generated/Module.cs new file mode 100644 index 000000000000..54441dccd21e --- /dev/null +++ b/swaggerci/consumption/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.Consumption +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.HttpPipeline _pipeline; + + /// the ISendAsync pipeline instance (when proxy is enabled) + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.ConsumptionManagementClient 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.Consumption.Module _instance; + + /// the singleton of this module class + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module()); + + /// The Name of this module + public string Name => @"Az.Consumption"; + + /// 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.Consumption"; + + /// 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.Consumption.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.Consumption.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.Consumption.Runtime.HttpPipeline for the remote call. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.ConsumptionManagementClient(); + _handler.Proxy = _webProxy; + _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient())); + _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/ConsumptionManagementClient.cs b/swaggerci/consumption/generated/api/ConsumptionManagementClient.cs new file mode 100644 index 000000000000..925249ca3897 --- /dev/null +++ b/swaggerci/consumption/generated/api/ConsumptionManagementClient.cs @@ -0,0 +1,5709 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Low-level API implementation for the ConsumptionManagementClient service. + /// Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. + /// + public partial class ConsumptionManagementClient + { + + /// + /// Provides the aggregate cost of a management group and all child management groups by current billing period. + /// + /// Azure Management Group ID. + /// May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc + /// time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// Tag filter is a key value pair string where key and value is separated by a colon (:). + /// 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.Consumption.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 AggregatedCostGetByManagementGroup(string managementGroupId, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Management/managementGroups/" + + global::System.Uri.EscapeDataString(managementGroupId) + + "/providers/Microsoft.Consumption/aggregatedcost" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AggregatedCostGetByManagementGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Provides the aggregate cost of a management group and all child management groups by current billing period. + /// + /// + /// May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc + /// time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// Tag filter is a key value pair string where key and value is separated by a colon (:). + /// 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.Consumption.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 AggregatedCostGetByManagementGroupViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Management/managementGroups/(?[^/]+)/providers/Microsoft.Consumption/aggregatedcost$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost'"); + } + + // replace URI parameters with values from identity + var managementGroupId = _match.Groups["managementGroupId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Management/managementGroups/" + + managementGroupId + + "/providers/Microsoft.Consumption/aggregatedcost" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AggregatedCostGetByManagementGroup_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.Consumption.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 AggregatedCostGetByManagementGroup_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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. + /// + /// Azure Management Group ID. + /// May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc + /// time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// Tag filter is a key value pair string where key and value is separated by a colon (:). + /// 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 AggregatedCostGetByManagementGroup_Validate(string managementGroupId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(managementGroupId),managementGroupId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// Provides the aggregate cost of a management group and all child management groups by specified billing period + /// + /// Azure Management Group ID. + /// Billing Period 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.Consumption.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 AggregatedCostGetForBillingPeriodByManagementGroup(string managementGroupId, string billingPeriodName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Management/managementGroups/" + + global::System.Uri.EscapeDataString(managementGroupId) + + "/providers/Microsoft.Billing/billingPeriods/" + + global::System.Uri.EscapeDataString(billingPeriodName) + + "/providers/Microsoft.Consumption/aggregatedCost" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AggregatedCostGetForBillingPeriodByManagementGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Provides the aggregate cost of a management group and all child management groups by specified billing period + /// + /// + /// 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.Consumption.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 AggregatedCostGetForBillingPeriodByManagementGroupViaIdentity(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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Management/managementGroups/(?[^/]+)/providers/Microsoft.Billing/billingPeriods/(?[^/]+)/providers/Microsoft.Consumption/aggregatedCost$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/aggregatedCost'"); + } + + // replace URI parameters with values from identity + var managementGroupId = _match.Groups["managementGroupId"].Value; + var billingPeriodName = _match.Groups["billingPeriodName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Management/managementGroups/" + + managementGroupId + + "/providers/Microsoft.Billing/billingPeriods/" + + billingPeriodName + + "/providers/Microsoft.Consumption/aggregatedCost" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AggregatedCostGetForBillingPeriodByManagementGroup_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.Consumption.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 AggregatedCostGetForBillingPeriodByManagementGroup_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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. + /// + /// Azure Management Group ID. + /// Billing Period 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 AggregatedCostGetForBillingPeriodByManagementGroup_Validate(string managementGroupId, string billingPeriodName, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(managementGroupId),managementGroupId); + await eventListener.AssertNotNull(nameof(billingPeriodName),billingPeriodName); + } + } + + /// + /// Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or later. + /// + /// BillingAccount 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.Consumption.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 BalancesGetByBillingAccount(string billingAccountId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/balances" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BalancesGetByBillingAccount_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or later. + /// + /// + /// 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.Consumption.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 BalancesGetByBillingAccountViaIdentity(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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/balances$", 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.Consumption/balances'"); + } + + // 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.Consumption/balances" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BalancesGetByBillingAccount_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.Consumption.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 BalancesGetByBillingAccount_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Balance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 + /// 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 BalancesGetByBillingAccount_Validate(string billingAccountId, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); + } + } + + /// + /// Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only for May + /// 1, 2014 or later. + /// + /// BillingAccount ID + /// Billing Period 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.Consumption.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 BalancesGetForBillingPeriodByBillingAccount(string billingAccountId, string billingPeriodName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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) + + "/billingPeriods/" + + global::System.Uri.EscapeDataString(billingPeriodName) + + "/providers/Microsoft.Consumption/balances" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BalancesGetForBillingPeriodByBillingAccount_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only for May + /// 1, 2014 or later. + /// + /// + /// 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.Consumption.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 BalancesGetForBillingPeriodByBillingAccountViaIdentity(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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/(?[^/]+)/billingPeriods/(?[^/]+)/providers/Microsoft.Consumption/balances$", 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}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances'"); + } + + // replace URI parameters with values from identity + var billingAccountId = _match.Groups["billingAccountId"].Value; + var billingPeriodName = _match.Groups["billingPeriodName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Billing/billingAccounts/" + + billingAccountId + + "/billingPeriods/" + + billingPeriodName + + "/providers/Microsoft.Consumption/balances" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BalancesGetForBillingPeriodByBillingAccount_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.Consumption.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 BalancesGetForBillingPeriodByBillingAccount_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Balance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 + /// Billing Period 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 BalancesGetForBillingPeriodByBillingAccount_Validate(string billingAccountId, string billingPeriodName, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); + await eventListener.AssertNotNull(nameof(billingPeriodName),billingPeriodName); + } + } + + /// + /// The operation to create or update a budget. You can optionally provide an eTag if desired as a form of concurrency control. + /// To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. + /// + /// The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection + /// scope. + /// Budget Name. + /// Parameters supplied to the Create Budget 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.Consumption.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 BudgetsCreateOrUpdate(string scope, string budgetName, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/budgets/" + + global::System.Uri.EscapeDataString(budgetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BudgetsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// The operation to create or update a budget. You can optionally provide an eTag if desired as a form of concurrency control. + /// To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. + /// + /// + /// Parameters supplied to the Create Budget 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.Consumption.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 BudgetsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/budgets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var budgetName = _match.Groups["budgetName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Consumption/budgets/" + + budgetName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BudgetsCreateOrUpdate_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.Consumption.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 BudgetsCreateOrUpdate_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Budget.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Budget.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection + /// scope. + /// Budget Name. + /// Parameters supplied to the Create Budget 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 BudgetsCreateOrUpdate_Validate(string scope, string budgetName, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget body, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(budgetName),budgetName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// The operation to delete a budget. + /// The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection + /// scope. + /// Budget 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.Consumption.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 BudgetsDelete(string scope, string budgetName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/budgets/" + + global::System.Uri.EscapeDataString(budgetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BudgetsDelete_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// The operation to delete a budget. + /// + /// 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.Consumption.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 BudgetsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/budgets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var budgetName = _match.Groups["budgetName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Consumption/budgets/" + + budgetName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BudgetsDelete_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.Consumption.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 BudgetsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection + /// scope. + /// Budget 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 BudgetsDelete_Validate(string scope, string budgetName, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(budgetName),budgetName); + } + } + + /// Gets the budget for the scope by budget name. + /// The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection + /// scope. + /// Budget 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.Consumption.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 BudgetsGet(string scope, string budgetName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/budgets/" + + global::System.Uri.EscapeDataString(budgetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BudgetsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the budget for the scope by budget 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.Consumption.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 BudgetsGetViaIdentity(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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/budgets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var budgetName = _match.Groups["budgetName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Consumption/budgets/" + + budgetName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BudgetsGet_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.Consumption.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 BudgetsGet_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Budget.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection + /// scope. + /// Budget 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 BudgetsGet_Validate(string scope, string budgetName, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(budgetName),budgetName); + } + } + + /// Lists all budgets for the defined scope. + /// The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection + /// 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.Consumption.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 BudgetsList(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/budgets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BudgetsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all budgets for the defined 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.Consumption.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 BudgetsListViaIdentity(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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/budgets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Consumption/budgets'"); + } + + // 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.Consumption/budgets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BudgetsList_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.Consumption.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 BudgetsList_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection + /// 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 BudgetsList_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + } + } + + /// Lists the charges based for the defined scope. + /// The scope associated with charges operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + /// for Department scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + /// for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing period to the scope using + /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope + /// use '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + /// 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. + /// Start date + /// End date + /// May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). + /// The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + /// is a key value pair string where key and value is separated by a colon (:). + /// May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, + /// properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. + /// 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.Consumption.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 ChargesList(string scope, string startDate, string endDate, string Filter, string Apply, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/charges" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(startDate) ? global::System.String.Empty : "startDate=" + global::System.Uri.EscapeDataString(startDate)) + + "&" + + (string.IsNullOrEmpty(endDate) ? global::System.String.Empty : "endDate=" + global::System.Uri.EscapeDataString(endDate)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Apply) ? global::System.String.Empty : "$apply=" + global::System.Uri.EscapeDataString(Apply)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChargesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the charges based for the defined scope. + /// + /// Start date + /// End date + /// May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). + /// The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + /// is a key value pair string where key and value is separated by a colon (:). + /// May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, + /// properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. + /// 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.Consumption.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 ChargesListViaIdentity(global::System.String viaIdentity, string startDate, string endDate, string Filter, string Apply, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/charges$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Consumption/charges'"); + } + + // 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.Consumption/charges" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(startDate) ? global::System.String.Empty : "startDate=" + global::System.Uri.EscapeDataString(startDate)) + + "&" + + (string.IsNullOrEmpty(endDate) ? global::System.String.Empty : "endDate=" + global::System.Uri.EscapeDataString(endDate)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Apply) ? global::System.String.Empty : "$apply=" + global::System.Uri.EscapeDataString(Apply)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChargesList_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.Consumption.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 ChargesList_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ChargesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 charges operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + /// for Department scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + /// for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing period to the scope using + /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope + /// use '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + /// 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. + /// Start date + /// End date + /// May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). + /// The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + /// is a key value pair string where key and value is separated by a colon (:). + /// May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, + /// properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. + /// 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 ChargesList_Validate(string scope, string startDate, string endDate, string Filter, string Apply, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(startDate),startDate); + await eventListener.AssertNotNull(nameof(endDate),endDate); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(Apply),Apply); + } + } + + /// The credit summary by billingAccountId and billingProfileId. + /// BillingAccount ID + /// Azure Billing Profile ID. + /// 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.Consumption.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 CreditsGet(string billingAccountId, string billingProfileId, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/credits/balanceSummary" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CreditsGet_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// The credit summary by billingAccountId and billingProfileId. + /// + /// 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.Consumption.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 CreditsGetViaIdentity(global::System.String viaIdentity, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/credits/balanceSummary$", 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.Consumption/credits/balanceSummary'"); + } + + // 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.Consumption/credits/balanceSummary" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CreditsGet_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.Consumption.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 CreditsGet_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditSummary.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 + /// Azure Billing Profile 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 CreditsGet_Validate(string billingAccountId, string billingProfileId, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); + await eventListener.AssertNotNull(nameof(billingProfileId),billingProfileId); + } + } + + /// + /// Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing + /// profile for a given start and end date. + /// + /// BillingAccount ID + /// May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', 'le', + /// 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and + /// value is separated by a colon (:). + /// 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.Consumption.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 EventsListByBillingAccount(string billingAccountId, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/events" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventsListByBillingAccount_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing + /// profile for a given start and end date. + /// + /// + /// May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', 'le', + /// 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and + /// value is separated by a colon (:). + /// 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.Consumption.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 EventsListByBillingAccountViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/events$", 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.Consumption/events'"); + } + + // 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.Consumption/events" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventsListByBillingAccount_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.Consumption.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 EventsListByBillingAccount_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Events.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 + /// May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', 'le', + /// 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and + /// value is separated by a colon (:). + /// 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 EventsListByBillingAccount_Validate(string billingAccountId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing + /// profile for a given start and end date. + /// + /// BillingAccount ID + /// Azure Billing Profile 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.Consumption.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 EventsListByBillingProfile(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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/events" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "startDate=" + global::System.Uri.EscapeDataString(startDate) + + "&" + + "endDate=" + global::System.Uri.EscapeDataString(endDate) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventsListByBillingProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing + /// profile for a given start and end date. + /// + /// + /// 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.Consumption.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 EventsListByBillingProfileViaIdentity(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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/events$", 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.Consumption/events'"); + } + + // 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.Consumption/events" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "startDate=" + global::System.Uri.EscapeDataString(startDate) + + "&" + + "endDate=" + global::System.Uri.EscapeDataString(endDate) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventsListByBillingProfile_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.Consumption.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 EventsListByBillingProfile_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Events.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 + /// Azure Billing Profile 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 EventsListByBillingProfile_Validate(string billingAccountId, string billingProfileId, string startDate, string endDate, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft Customer + /// Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. + /// + /// BillingAccount ID + /// May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + /// 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and + /// value is separated by a colon (:). + /// 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.Consumption.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 LotsListByBillingAccount(string billingAccountId, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/lots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LotsListByBillingAccount_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft Customer + /// Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. + /// + /// + /// May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + /// 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and + /// value is separated by a colon (:). + /// 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.Consumption.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 LotsListByBillingAccountViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/lots$", 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.Consumption/lots'"); + } + + // 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.Consumption/lots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LotsListByBillingAccount_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.Consumption.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 LotsListByBillingAccount_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Lots.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 + /// May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + /// 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and + /// value is separated by a colon (:). + /// 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 LotsListByBillingAccount_Validate(string billingAccountId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft Customer Agreements + /// (MCA) billing accounts. + /// + /// BillingAccount ID + /// Azure Billing Profile 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.Consumption.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 LotsListByBillingProfile(string billingAccountId, string billingProfileId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/lots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LotsListByBillingProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft Customer Agreements + /// (MCA) billing accounts. + /// + /// + /// 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.Consumption.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 LotsListByBillingProfileViaIdentity(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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/lots$", 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.Consumption/lots'"); + } + + // 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.Consumption/lots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LotsListByBillingProfile_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.Consumption.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 LotsListByBillingProfile_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Lots.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 + /// Azure Billing Profile 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 LotsListByBillingProfile_Validate(string billingAccountId, string billingProfileId, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); + await eventListener.AssertNotNull(nameof(billingProfileId),billingProfileId); + } + } + + /// + /// Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing accounts. + /// + /// BillingAccount ID + /// Customer ID + /// May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + /// 'ge', and 'and'. Tag filter is a key value pair string where key and value is separated by a colon (:). + /// 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.Consumption.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 LotsListByCustomer(string billingAccountId, string customerId, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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) + + "/customers/" + + global::System.Uri.EscapeDataString(customerId) + + "/providers/Microsoft.Consumption/lots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LotsListByCustomer_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing accounts. + /// + /// + /// May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + /// 'ge', and 'and'. Tag filter is a key value pair string where key and value is separated by a colon (:). + /// 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.Consumption.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 LotsListByCustomerViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/(?[^/]+)/customers/(?[^/]+)/providers/Microsoft.Consumption/lots$", 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}/customers/{customerId}/providers/Microsoft.Consumption/lots'"); + } + + // replace URI parameters with values from identity + var billingAccountId = _match.Groups["billingAccountId"].Value; + var customerId = _match.Groups["customerId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Billing/billingAccounts/" + + billingAccountId + + "/customers/" + + customerId + + "/providers/Microsoft.Consumption/lots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LotsListByCustomer_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.Consumption.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 LotsListByCustomer_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Lots.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 + /// Customer ID + /// May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + /// 'ge', and 'and'. Tag filter is a key value pair string where key and value is separated by a colon (:). + /// 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 LotsListByCustomer_Validate(string billingAccountId, string customerId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); + await eventListener.AssertNotNull(nameof(customerId),customerId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, 2014 + /// or later. + /// + /// May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc + /// time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', + /// 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// May be used to limit the number of results to the most recent N marketplaces. + /// 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. + /// The scope associated with marketplace 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 + /// and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, + /// billing account, department, enrollment account and ManagementGroup, you can also add billing period to the scope using + /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope + /// use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + /// 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.Consumption.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 MarketplacesList(string Filter, int? Top, string Skiptoken, string scope, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/marketplaces" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MarketplacesList_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, 2014 + /// or later. + /// + /// + /// May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc + /// time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', + /// 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// May be used to limit the number of results to the most recent N marketplaces. + /// 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. + /// 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.Consumption.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 MarketplacesListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, string Skiptoken, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/marketplaces$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Consumption/marketplaces'"); + } + + // 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.Consumption/marketplaces" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MarketplacesList_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.Consumption.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 MarketplacesList_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MarketplacesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc + /// time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', + /// 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// May be used to limit the number of results to the most recent N marketplaces. + /// 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. + /// The scope associated with marketplace 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 + /// and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, + /// billing account, department, enrollment account and ManagementGroup, you can also add billing period to the scope using + /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope + /// use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + /// 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 MarketplacesList_Validate(string Filter, int? Top, string Skiptoken, string scope, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertIsLessThanOrEqual(nameof(Top),Top,1000); + await eventListener.AssertNotNull(nameof(Skiptoken),Skiptoken); + await eventListener.AssertNotNull(nameof(scope),scope); + } + } + + /// Lists all of the available consumption 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.Consumption.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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Consumption/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 consumption 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.Consumption.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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Consumption/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Consumption/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// + /// Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. + /// + /// May be used to expand the properties/meterDetails within a price sheet. By default, these fields + /// are not included when returning price sheet. + /// 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 top N results. + /// Azure Subscription 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.Consumption.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 PriceSheetGet(string Expand, string Skiptoken, int? Top, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Consumption/pricesheets/default" + + "?" + + (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())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PriceSheetGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only for May + /// 1, 2014 or later. + /// + /// May be used to expand the properties/meterDetails within a price sheet. By default, these fields + /// are not included when returning price sheet. + /// 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 top N results. + /// Azure Subscription ID. + /// Billing Period 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.Consumption.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 PriceSheetGetByBillingPeriod(string Expand, string Skiptoken, int? Top, string subscriptionId, string billingPeriodName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Billing/billingPeriods/" + + global::System.Uri.EscapeDataString(billingPeriodName) + + "/providers/Microsoft.Consumption/pricesheets/default" + + "?" + + (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())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PriceSheetGetByBillingPeriod_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only for May + /// 1, 2014 or later. + /// + /// + /// May be used to expand the properties/meterDetails within a price sheet. By default, these fields + /// are not included when returning price sheet. + /// 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 top N results. + /// 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.Consumption.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 PriceSheetGetByBillingPeriodViaIdentity(global::System.String viaIdentity, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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("^/subscriptions/(?[^/]+)/providers/Microsoft.Billing/billingPeriods/(?[^/]+)/providers/Microsoft.Consumption/pricesheets/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var billingPeriodName = _match.Groups["billingPeriodName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.Billing/billingPeriods/" + + billingPeriodName + + "/providers/Microsoft.Consumption/pricesheets/default" + + "?" + + (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())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PriceSheetGetByBillingPeriod_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.Consumption.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 PriceSheetGetByBillingPeriod_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 expand the properties/meterDetails within a price sheet. By default, these fields + /// are not included when returning price sheet. + /// 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 top N results. + /// Azure Subscription ID. + /// Billing Period 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 PriceSheetGetByBillingPeriod_Validate(string Expand, string Skiptoken, int? Top, string subscriptionId, string billingPeriodName, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(Skiptoken),Skiptoken); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertIsLessThanOrEqual(nameof(Top),Top,1000); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(billingPeriodName),billingPeriodName); + } + } + + /// + /// Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. + /// + /// + /// May be used to expand the properties/meterDetails within a price sheet. By default, these fields + /// are not included when returning price sheet. + /// 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 top N results. + /// 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.Consumption.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 PriceSheetGetViaIdentity(global::System.String viaIdentity, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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("^/subscriptions/(?[^/]+)/providers/Microsoft.Consumption/pricesheets/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.Consumption/pricesheets/default" + + "?" + + (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())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PriceSheetGet_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.Consumption.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 PriceSheetGet_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 expand the properties/meterDetails within a price sheet. By default, these fields + /// are not included when returning price sheet. + /// 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 top N results. + /// Azure Subscription 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 PriceSheetGet_Validate(string Expand, string Skiptoken, int? Top, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(Skiptoken),Skiptoken); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertIsLessThanOrEqual(nameof(Top),Top,1000); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// + /// Details of a reservation recommendation for what-if analysis of reserved instances. + /// + /// The scope associated with reservation recommendation details operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for billingProfile scope + /// Scope of the reservation. + /// Used to select the region the recommendation should be generated for. + /// Specify length of reservation recommendation term. + /// Filter the time period on which reservation recommendation results are based. + /// Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 + /// (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks) + /// 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.Consumption.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 ReservationRecommendationDetailsGet(string resourceScope, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope scope, string region, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term term, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod lookBackPeriod, string product, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceScope) + + "/providers/Microsoft.Consumption/reservationRecommendationDetails" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "scope=" + global::System.Uri.EscapeDataString(scope) + + "&" + + "region=" + global::System.Uri.EscapeDataString(region) + + "&" + + "term=" + global::System.Uri.EscapeDataString(term) + + "&" + + "lookBackPeriod=" + global::System.Uri.EscapeDataString(lookBackPeriod) + + "&" + + "product=" + global::System.Uri.EscapeDataString(product) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationRecommendationDetailsGet_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Details of a reservation recommendation for what-if analysis of reserved instances. + /// + /// + /// Scope of the reservation. + /// Used to select the region the recommendation should be generated for. + /// Specify length of reservation recommendation term. + /// Filter the time period on which reservation recommendation results are based. + /// Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 + /// (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks) + /// 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.Consumption.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 ReservationRecommendationDetailsGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope scope, string region, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term term, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod lookBackPeriod, string product, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/reservationRecommendationDetails$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendationDetails'"); + } + + // replace URI parameters with values from identity + var resourceScope = _match.Groups["resourceScope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceScope + + "/providers/Microsoft.Consumption/reservationRecommendationDetails" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "scope=" + global::System.Uri.EscapeDataString(scope) + + "&" + + "region=" + global::System.Uri.EscapeDataString(region) + + "&" + + "term=" + global::System.Uri.EscapeDataString(term) + + "&" + + "lookBackPeriod=" + global::System.Uri.EscapeDataString(lookBackPeriod) + + "&" + + "product=" + global::System.Uri.EscapeDataString(product) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationRecommendationDetailsGet_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.Consumption.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 ReservationRecommendationDetailsGet_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsModel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.HighCasedErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 reservation recommendation details operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for billingProfile scope + /// Scope of the reservation. + /// Used to select the region the recommendation should be generated for. + /// Specify length of reservation recommendation term. + /// Filter the time period on which reservation recommendation results are based. + /// Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 + /// (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks) + /// 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 ReservationRecommendationDetailsGet_Validate(string resourceScope, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope scope, string region, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term term, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod lookBackPeriod, string product, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceScope),resourceScope); + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertEnum(nameof(scope),scope,@"Single", @"Shared"); + await eventListener.AssertNotNull(nameof(region),region); + await eventListener.AssertNotNull(nameof(term),term); + await eventListener.AssertEnum(nameof(term),term,@"P1Y", @"P3Y"); + await eventListener.AssertNotNull(nameof(lookBackPeriod),lookBackPeriod); + await eventListener.AssertEnum(nameof(lookBackPeriod),lookBackPeriod,@"Last7Days", @"Last30Days", @"Last60Days"); + await eventListener.AssertNotNull(nameof(product),product); + } + } + + /// List of recommendations for purchasing reserved instances. + /// May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', + /// 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', + /// 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', + /// 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod + /// with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + /// The scope associated with reservation recommendations operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for billingProfile scope + /// 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.Consumption.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 ReservationRecommendationsList(string Filter, string resourceScope, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceScope) + + "/providers/Microsoft.Consumption/reservationRecommendations" + + "?" + + (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.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationRecommendationsList_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// List of recommendations for purchasing reserved instances. + /// + /// May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', + /// 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', + /// 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', + /// 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod + /// with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + /// 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.Consumption.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 ReservationRecommendationsListViaIdentity(global::System.String viaIdentity, string Filter, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/reservationRecommendations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendations'"); + } + + // replace URI parameters with values from identity + var resourceScope = _match.Groups["resourceScope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceScope + + "/providers/Microsoft.Consumption/reservationRecommendations" + + "?" + + (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.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationRecommendationsList_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.Consumption.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 ReservationRecommendationsList_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 reservationRecommendations by: properties/scope with allowed values ['Single', + /// 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', + /// 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', + /// 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod + /// with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + /// The scope associated with reservation recommendations operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for billingProfile scope + /// 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 ReservationRecommendationsList_Validate(string Filter, string resourceScope, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(resourceScope),resourceScope); + } + } + + /// + /// List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted along with + /// its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May 2021. This + /// refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase + /// was made. + /// + /// Filter reservation transactions by date range. The properties/EventDate for start date and end date. + /// The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For + /// example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for the entire + /// December 2020 month (i.e. will contain records for dates December 30 and 31) + /// BillingAccount 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.Consumption.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 ReservationTransactionsList(string Filter, string billingAccountId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/reservationTransactions" + + "?" + + (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.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationTransactionsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List of transactions for reserved instances on billing profile scope. The refund transactions are posted along with its + /// purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May 2021. This refund + /// transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made. + /// + /// Filter reservation transactions by date range. The properties/EventDate for start date and end date. + /// The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For + /// example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for entire + /// December 2020 month (i.e. will contain records for dates December 30 and 31) + /// BillingAccount ID + /// Azure Billing Profile 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.Consumption.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 ReservationTransactionsListByBillingProfile(string Filter, string billingAccountId, string billingProfileId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/reservationTransactions" + + "?" + + (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.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationTransactionsListByBillingProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List of transactions for reserved instances on billing profile scope. The refund transactions are posted along with its + /// purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May 2021. This refund + /// transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made. + /// + /// + /// Filter reservation transactions by date range. The properties/EventDate for start date and end date. + /// The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For + /// example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for entire + /// December 2020 month (i.e. will contain records for dates December 30 and 31) + /// 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.Consumption.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 ReservationTransactionsListByBillingProfileViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/reservationTransactions$", 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.Consumption/reservationTransactions'"); + } + + // 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.Consumption/reservationTransactions" + + "?" + + (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.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationTransactionsListByBillingProfile_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.Consumption.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 ReservationTransactionsListByBillingProfile_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransactionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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. + /// + /// Filter reservation transactions by date range. The properties/EventDate for start date and end date. + /// The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For + /// example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for entire + /// December 2020 month (i.e. will contain records for dates December 30 and 31) + /// BillingAccount ID + /// Azure Billing Profile 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 ReservationTransactionsListByBillingProfile_Validate(string Filter, string billingAccountId, string billingProfileId, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); + await eventListener.AssertNotNull(nameof(billingProfileId),billingProfileId); + } + } + + /// + /// List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted along with + /// its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May 2021. This + /// refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase + /// was made. + /// + /// + /// Filter reservation transactions by date range. The properties/EventDate for start date and end date. + /// The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For + /// example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for the entire + /// December 2020 month (i.e. will contain records for dates December 30 and 31) + /// 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.Consumption.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 ReservationTransactionsListViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/reservationTransactions$", 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.Consumption/reservationTransactions'"); + } + + // 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.Consumption/reservationTransactions" + + "?" + + (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.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationTransactionsList_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.Consumption.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 ReservationTransactionsList_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransactionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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. + /// + /// Filter reservation transactions by date range. The properties/EventDate for start date and end date. + /// The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For + /// example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for the entire + /// December 2020 month (i.e. will contain records for dates December 30 and 31) + /// BillingAccount 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 ReservationTransactionsList_Validate(string Filter, string billingAccountId, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); + } + } + + /// + /// Lists the reservations details for the defined scope and provided date range. Note: ARM has a payload size limit of 12MB, + /// so currently callers get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with + /// smaller date ranges. + /// + /// The scope associated with reservations details operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for BillingProfile scope (modern). + /// Start date. Only applicable when querying with billing profile + /// End date. Only applicable when querying with billing profile + /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The + /// filter supports 'le' and 'ge'. Not applicable when querying with billing profile + /// Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific + /// reservation + /// Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific + /// reservation order + /// 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.Consumption.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 ReservationsDetailsList(string resourceScope, string startDate, string endDate, string Filter, string reservationId, string reservationOrderId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceScope) + + "/providers/Microsoft.Consumption/reservationDetails" + + "?" + + (string.IsNullOrEmpty(startDate) ? global::System.String.Empty : "startDate=" + global::System.Uri.EscapeDataString(startDate)) + + "&" + + (string.IsNullOrEmpty(endDate) ? global::System.String.Empty : "endDate=" + global::System.Uri.EscapeDataString(endDate)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(reservationId) ? global::System.String.Empty : "reservationId=" + global::System.Uri.EscapeDataString(reservationId)) + + "&" + + (string.IsNullOrEmpty(reservationOrderId) ? global::System.String.Empty : "reservationOrderId=" + global::System.Uri.EscapeDataString(reservationOrderId)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationsDetailsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently callers + /// get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. + /// + /// Order Id of the reservation + /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The + /// filter supports 'le' and 'ge' + /// 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.Consumption.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 ReservationsDetailsListByReservationOrder(string reservationOrderId, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationorders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/providers/Microsoft.Consumption/reservationDetails" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationsDetailsListByReservationOrder_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently callers + /// get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. + /// + /// Order Id of the reservation + /// Id of the reservation + /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The + /// filter supports 'le' and 'ge' + /// 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.Consumption.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 ReservationsDetailsListByReservationOrderAndReservation(string reservationOrderId, string reservationId, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationorders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/reservations/" + + global::System.Uri.EscapeDataString(reservationId) + + "/providers/Microsoft.Consumption/reservationDetails" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationsDetailsListByReservationOrderAndReservation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently callers + /// get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. + /// + /// + /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The + /// filter supports 'le' and 'ge' + /// 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.Consumption.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 ReservationsDetailsListByReservationOrderAndReservationViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Capacity/reservationorders/(?[^/]+)/reservations/(?[^/]+)/providers/Microsoft.Consumption/reservationDetails$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails'"); + } + + // replace URI parameters with values from identity + var reservationOrderId = _match.Groups["reservationOrderId"].Value; + var reservationId = _match.Groups["reservationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationorders/" + + reservationOrderId + + "/reservations/" + + reservationId + + "/providers/Microsoft.Consumption/reservationDetails" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationsDetailsListByReservationOrderAndReservation_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.Consumption.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 ReservationsDetailsListByReservationOrderAndReservation_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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. + /// + /// Order Id of the reservation + /// Id of the reservation + /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The + /// filter supports 'le' and 'ge' + /// 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 ReservationsDetailsListByReservationOrderAndReservation_Validate(string reservationOrderId, string reservationId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); + await eventListener.AssertNotNull(nameof(reservationId),reservationId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently callers + /// get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. + /// + /// + /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The + /// filter supports 'le' and 'ge' + /// 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.Consumption.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 ReservationsDetailsListByReservationOrderViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Capacity/reservationorders/(?[^/]+)/providers/Microsoft.Consumption/reservationDetails$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails'"); + } + + // replace URI parameters with values from identity + var reservationOrderId = _match.Groups["reservationOrderId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationorders/" + + reservationOrderId + + "/providers/Microsoft.Consumption/reservationDetails" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationsDetailsListByReservationOrder_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.Consumption.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 ReservationsDetailsListByReservationOrder_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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. + /// + /// Order Id of the reservation + /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The + /// filter supports 'le' and 'ge' + /// 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 ReservationsDetailsListByReservationOrder_Validate(string reservationOrderId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// Lists the reservations details for the defined scope and provided date range. Note: ARM has a payload size limit of 12MB, + /// so currently callers get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with + /// smaller date ranges. + /// + /// + /// Start date. Only applicable when querying with billing profile + /// End date. Only applicable when querying with billing profile + /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The + /// filter supports 'le' and 'ge'. Not applicable when querying with billing profile + /// Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific + /// reservation + /// Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific + /// reservation order + /// 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.Consumption.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 ReservationsDetailsListViaIdentity(global::System.String viaIdentity, string startDate, string endDate, string Filter, string reservationId, string reservationOrderId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/reservationDetails$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceScope}/providers/Microsoft.Consumption/reservationDetails'"); + } + + // replace URI parameters with values from identity + var resourceScope = _match.Groups["resourceScope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceScope + + "/providers/Microsoft.Consumption/reservationDetails" + + "?" + + (string.IsNullOrEmpty(startDate) ? global::System.String.Empty : "startDate=" + global::System.Uri.EscapeDataString(startDate)) + + "&" + + (string.IsNullOrEmpty(endDate) ? global::System.String.Empty : "endDate=" + global::System.Uri.EscapeDataString(endDate)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(reservationId) ? global::System.String.Empty : "reservationId=" + global::System.Uri.EscapeDataString(reservationId)) + + "&" + + (string.IsNullOrEmpty(reservationOrderId) ? global::System.String.Empty : "reservationOrderId=" + global::System.Uri.EscapeDataString(reservationOrderId)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationsDetailsList_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.Consumption.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 ReservationsDetailsList_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 reservations details operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for BillingProfile scope (modern). + /// Start date. Only applicable when querying with billing profile + /// End date. Only applicable when querying with billing profile + /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The + /// filter supports 'le' and 'ge'. Not applicable when querying with billing profile + /// Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific + /// reservation + /// Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific + /// reservation order + /// 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 ReservationsDetailsList_Validate(string resourceScope, string startDate, string endDate, string Filter, string reservationId, string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceScope),resourceScope); + await eventListener.AssertNotNull(nameof(startDate),startDate); + await eventListener.AssertNotNull(nameof(endDate),endDate); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(reservationId),reservationId); + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); + } + } + + /// Lists the reservations summaries for the defined scope daily or monthly grain. + /// The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for BillingProfile scope (modern). + /// Can be daily or monthly + /// Start date. Only applicable when querying with billing profile + /// End date. Only applicable when querying with billing profile + /// Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports + /// 'le' and 'ge'. Not applicable when querying with billing profile + /// Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific + /// reservation + /// Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific + /// reservation order + /// 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.Consumption.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 ReservationsSummariesList(string resourceScope, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain grain, string startDate, string endDate, string Filter, string reservationId, string reservationOrderId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceScope) + + "/providers/Microsoft.Consumption/reservationSummaries" + + "?" + + "grain=" + global::System.Uri.EscapeDataString(grain) + + "&" + + (string.IsNullOrEmpty(startDate) ? global::System.String.Empty : "startDate=" + global::System.Uri.EscapeDataString(startDate)) + + "&" + + (string.IsNullOrEmpty(endDate) ? global::System.String.Empty : "endDate=" + global::System.Uri.EscapeDataString(endDate)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(reservationId) ? global::System.String.Empty : "reservationId=" + global::System.Uri.EscapeDataString(reservationId)) + + "&" + + (string.IsNullOrEmpty(reservationOrderId) ? global::System.String.Empty : "reservationOrderId=" + global::System.Uri.EscapeDataString(reservationOrderId)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationsSummariesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the reservations summaries for daily or monthly grain. + /// Order Id of the reservation + /// Can be daily or monthly + /// Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports + /// 'le' and 'ge' + /// 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.Consumption.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 ReservationsSummariesListByReservationOrder(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain grain, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationorders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/providers/Microsoft.Consumption/reservationSummaries" + + "?" + + "grain=" + global::System.Uri.EscapeDataString(grain) + + "&" + + (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.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationsSummariesListByReservationOrder_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the reservations summaries for daily or monthly grain. + /// Order Id of the reservation + /// Id of the reservation + /// Can be daily or monthly + /// Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports + /// 'le' and 'ge' + /// 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.Consumption.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 ReservationsSummariesListByReservationOrderAndReservation(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain grain, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationorders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/reservations/" + + global::System.Uri.EscapeDataString(reservationId) + + "/providers/Microsoft.Consumption/reservationSummaries" + + "?" + + "grain=" + global::System.Uri.EscapeDataString(grain) + + "&" + + (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.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationsSummariesListByReservationOrderAndReservation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the reservations summaries for daily or monthly grain. + /// + /// Can be daily or monthly + /// Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports + /// 'le' and 'ge' + /// 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.Consumption.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 ReservationsSummariesListByReservationOrderAndReservationViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain grain, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Capacity/reservationorders/(?[^/]+)/reservations/(?[^/]+)/providers/Microsoft.Consumption/reservationSummaries$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries'"); + } + + // replace URI parameters with values from identity + var reservationOrderId = _match.Groups["reservationOrderId"].Value; + var reservationId = _match.Groups["reservationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationorders/" + + reservationOrderId + + "/reservations/" + + reservationId + + "/providers/Microsoft.Consumption/reservationSummaries" + + "?" + + "grain=" + global::System.Uri.EscapeDataString(grain) + + "&" + + (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.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationsSummariesListByReservationOrderAndReservation_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.Consumption.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 ReservationsSummariesListByReservationOrderAndReservation_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummariesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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. + /// + /// Order Id of the reservation + /// Id of the reservation + /// Can be daily or monthly + /// Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports + /// 'le' and 'ge' + /// 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 ReservationsSummariesListByReservationOrderAndReservation_Validate(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain grain, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); + await eventListener.AssertNotNull(nameof(reservationId),reservationId); + await eventListener.AssertNotNull(nameof(grain),grain); + await eventListener.AssertEnum(nameof(grain),grain,@"daily", @"monthly"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Lists the reservations summaries for daily or monthly grain. + /// + /// Can be daily or monthly + /// Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports + /// 'le' and 'ge' + /// 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.Consumption.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 ReservationsSummariesListByReservationOrderViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain grain, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Capacity/reservationorders/(?[^/]+)/providers/Microsoft.Consumption/reservationSummaries$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries'"); + } + + // replace URI parameters with values from identity + var reservationOrderId = _match.Groups["reservationOrderId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationorders/" + + reservationOrderId + + "/providers/Microsoft.Consumption/reservationSummaries" + + "?" + + "grain=" + global::System.Uri.EscapeDataString(grain) + + "&" + + (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.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationsSummariesListByReservationOrder_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.Consumption.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 ReservationsSummariesListByReservationOrder_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummariesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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. + /// + /// Order Id of the reservation + /// Can be daily or monthly + /// Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports + /// 'le' and 'ge' + /// 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 ReservationsSummariesListByReservationOrder_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain grain, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); + await eventListener.AssertNotNull(nameof(grain),grain); + await eventListener.AssertEnum(nameof(grain),grain,@"daily", @"monthly"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Lists the reservations summaries for the defined scope daily or monthly grain. + /// + /// Can be daily or monthly + /// Start date. Only applicable when querying with billing profile + /// End date. Only applicable when querying with billing profile + /// Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports + /// 'le' and 'ge'. Not applicable when querying with billing profile + /// Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific + /// reservation + /// Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific + /// reservation order + /// 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.Consumption.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 ReservationsSummariesListViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain grain, string startDate, string endDate, string Filter, string reservationId, string reservationOrderId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/reservationSummaries$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceScope}/providers/Microsoft.Consumption/reservationSummaries'"); + } + + // replace URI parameters with values from identity + var resourceScope = _match.Groups["resourceScope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceScope + + "/providers/Microsoft.Consumption/reservationSummaries" + + "?" + + "grain=" + global::System.Uri.EscapeDataString(grain) + + "&" + + (string.IsNullOrEmpty(startDate) ? global::System.String.Empty : "startDate=" + global::System.Uri.EscapeDataString(startDate)) + + "&" + + (string.IsNullOrEmpty(endDate) ? global::System.String.Empty : "endDate=" + global::System.Uri.EscapeDataString(endDate)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(reservationId) ? global::System.String.Empty : "reservationId=" + global::System.Uri.EscapeDataString(reservationId)) + + "&" + + (string.IsNullOrEmpty(reservationOrderId) ? global::System.String.Empty : "reservationOrderId=" + global::System.Uri.EscapeDataString(reservationOrderId)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationsSummariesList_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.Consumption.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 ReservationsSummariesList_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummariesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for BillingProfile scope (modern). + /// Can be daily or monthly + /// Start date. Only applicable when querying with billing profile + /// End date. Only applicable when querying with billing profile + /// Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports + /// 'le' and 'ge'. Not applicable when querying with billing profile + /// Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific + /// reservation + /// Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific + /// reservation order + /// 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 ReservationsSummariesList_Validate(string resourceScope, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain grain, string startDate, string endDate, string Filter, string reservationId, string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceScope),resourceScope); + await eventListener.AssertNotNull(nameof(grain),grain); + await eventListener.AssertEnum(nameof(grain),grain,@"daily", @"monthly"); + await eventListener.AssertNotNull(nameof(startDate),startDate); + await eventListener.AssertNotNull(nameof(endDate),endDate); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(reservationId),reservationId); + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); + } + } + + /// Get all available tag keys for the defined scope + /// The scope associated with tags 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management + /// Group scope.. + /// 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.Consumption.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 TagsGet(string scope, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/tags" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagsGet_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Get all available tag keys for the defined scope + /// + /// 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.Consumption.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 TagsGetViaIdentity(global::System.String viaIdentity, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/tags$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Consumption/tags'"); + } + + // 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.Consumption/tags" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagsGet_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.Consumption.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 TagsGet_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagsResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 tags 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management + /// Group 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 TagsGet_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + } + } + + /// + /// Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later. + /// + /// 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 + /// and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, + /// billing account, department, enrollment account and management group, you can also add billing period to the scope using + /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope + /// use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + /// 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. + /// May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage + /// details. By default, these fields are not included when listing usage details. + /// May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, + /// properties/chargeType, properties/reservationId, properties/publisherType or tags. The filter supports 'eq', 'lt', 'gt', + /// 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where + /// key and value is separated by a colon (:). PublisherType Filter accepts two values azure and marketplace and it is currently + /// supported for Web Direct Offer Type + /// 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 usageDetails. + /// Allows to select different type of cost/usage records. + /// 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.Consumption.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 UsageDetailsList(string scope, string Expand, string Filter, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype? metric, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/usageDetails" + + "?" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (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())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(metric) ? global::System.String.Empty : "metric=" + global::System.Uri.EscapeDataString(metric)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsageDetailsList_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later. + /// + /// + /// May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage + /// details. By default, these fields are not included when listing usage details. + /// May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, + /// properties/chargeType, properties/reservationId, properties/publisherType or tags. The filter supports 'eq', 'lt', 'gt', + /// 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where + /// key and value is separated by a colon (:). PublisherType Filter accepts two values azure and marketplace and it is currently + /// supported for Web Direct Offer Type + /// 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 usageDetails. + /// Allows to select different type of cost/usage records. + /// 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.Consumption.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 UsageDetailsListViaIdentity(global::System.String viaIdentity, string Expand, string Filter, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype? metric, 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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption/usageDetails$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Consumption/usageDetails'"); + } + + // 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.Consumption/usageDetails" + + "?" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (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())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(metric) ? global::System.String.Empty : "metric=" + global::System.Uri.EscapeDataString(metric)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsageDetailsList_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.Consumption.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 UsageDetailsList_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.Consumption.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.UsageDetailsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 + /// and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, + /// billing account, department, enrollment account and management group, you can also add billing period to the scope using + /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope + /// use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + /// 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. + /// May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage + /// details. By default, these fields are not included when listing usage details. + /// May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, + /// properties/chargeType, properties/reservationId, properties/publisherType or tags. The filter supports 'eq', 'lt', 'gt', + /// 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where + /// key and value is separated by a colon (:). PublisherType Filter accepts two values azure and marketplace and it is currently + /// supported for Web Direct Offer Type + /// 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 usageDetails. + /// Allows to select different type of cost/usage records. + /// 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 UsageDetailsList_Validate(string scope, string Expand, string Filter, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype? metric, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(Skiptoken),Skiptoken); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertIsLessThanOrEqual(nameof(Top),Top,1000); + await eventListener.AssertNotNull(nameof(metric),metric); + await eventListener.AssertEnum(nameof(metric),metric,@"actualcost", @"amortizedcost", @"usage"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Amount.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Amount.PowerShell.cs new file mode 100644 index 000000000000..8b9cad6abbf2 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Amount.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The amount plus currency . + [System.ComponentModel.TypeConverter(typeof(AmountTypeConverter))] + public partial class Amount + { + + /// + /// 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 Amount(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Value = (decimal?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Value, (__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 Amount(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Value = (decimal?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Value, (__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.Consumption.Models.Api20211001.IAmount DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Amount(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.Consumption.Models.Api20211001.IAmount DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Amount(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.Consumption.Models.Api20211001.IAmount FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The amount plus currency . + [System.ComponentModel.TypeConverter(typeof(AmountTypeConverter))] + public partial interface IAmount + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Amount.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Amount.TypeConverter.cs new file mode 100644 index 000000000000..5cbce14045f2 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Amount.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AmountTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IAmount ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Amount.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Amount.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Amount.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/consumption/generated/api/Models/Api20211001/Amount.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Amount.cs new file mode 100644 index 000000000000..9872b621abbb --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Amount.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The amount plus currency . + public partial class Amount : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal + { + + /// Backing field for property. + private string _currency; + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Currency { get => this._currency; } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal.Currency { get => this._currency; set { {_currency = value;} } } + + /// Internal Acessors for Value + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private decimal? _value; + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Value { get => this._value; } + + /// Creates an new instance. + public Amount() + { + + } + } + /// The amount plus currency . + public partial interface IAmount : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Value { get; } + + } + /// The amount plus currency . + internal partial interface IAmountInternal + + { + /// Amount currency. + string Currency { get; set; } + /// Amount. + decimal? Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Amount.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Amount.json.cs new file mode 100644 index 000000000000..2a2cfeda0bd5 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Amount.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The amount plus currency . + public partial class Amount + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal Amount(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_currency = If( json?.PropertyT("currency"), out var __jsonCurrency) ? (string)__jsonCurrency : (string)Currency;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (decimal?)__jsonValue : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new Amount(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._currency.ToString()) : null, "currency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._value) : null, "value" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/AmountWithExchangeRate.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/AmountWithExchangeRate.PowerShell.cs new file mode 100644 index 000000000000..19522e2bb592 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/AmountWithExchangeRate.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The amount with exchange rate. + [System.ComponentModel.TypeConverter(typeof(AmountWithExchangeRateTypeConverter))] + public partial class AmountWithExchangeRate + { + + /// + /// 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 AmountWithExchangeRate(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)this).ExchangeRate = (decimal?) content.GetValueForProperty("ExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)this).ExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)this).ExchangeRateMonth = (int?) content.GetValueForProperty("ExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)this).ExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Value = (decimal?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Value, (__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 AmountWithExchangeRate(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)this).ExchangeRate = (decimal?) content.GetValueForProperty("ExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)this).ExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)this).ExchangeRateMonth = (int?) content.GetValueForProperty("ExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)this).ExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Value = (decimal?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)this).Value, (__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.Consumption.Models.Api20211001.IAmountWithExchangeRate DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AmountWithExchangeRate(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.Consumption.Models.Api20211001.IAmountWithExchangeRate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AmountWithExchangeRate(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.Consumption.Models.Api20211001.IAmountWithExchangeRate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The amount with exchange rate. + [System.ComponentModel.TypeConverter(typeof(AmountWithExchangeRateTypeConverter))] + public partial interface IAmountWithExchangeRate + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/AmountWithExchangeRate.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/AmountWithExchangeRate.TypeConverter.cs new file mode 100644 index 000000000000..fd88f6a63b44 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/AmountWithExchangeRate.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AmountWithExchangeRateTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IAmountWithExchangeRate ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AmountWithExchangeRate.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AmountWithExchangeRate.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AmountWithExchangeRate.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/consumption/generated/api/Models/Api20211001/AmountWithExchangeRate.cs b/swaggerci/consumption/generated/api/Models/Api20211001/AmountWithExchangeRate.cs new file mode 100644 index 000000000000..649b766ab9b0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/AmountWithExchangeRate.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The amount with exchange rate. + public partial class AmountWithExchangeRate : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount __amount = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount(); + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)__amount).Currency; } + + /// Backing field for property. + private decimal? _exchangeRate; + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? ExchangeRate { get => this._exchangeRate; } + + /// Backing field for property. + private int? _exchangeRateMonth; + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public int? ExchangeRateMonth { get => this._exchangeRateMonth; } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal.Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)__amount).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)__amount).Currency = value; } + + /// Internal Acessors for Value + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal.Value { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)__amount).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)__amount).Value = value; } + + /// Internal Acessors for ExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal.ExchangeRate { get => this._exchangeRate; set { {_exchangeRate = value;} } } + + /// Internal Acessors for ExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal.ExchangeRateMonth { get => this._exchangeRateMonth; set { {_exchangeRateMonth = value;} } } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? Value { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)__amount).Value; } + + /// Creates an new instance. + public AmountWithExchangeRate() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__amount), __amount); + await eventListener.AssertObjectIsValid(nameof(__amount), __amount); + } + } + /// The amount with exchange rate. + public partial interface IAmountWithExchangeRate : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount + { + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? ExchangeRateMonth { get; } + + } + /// The amount with exchange rate. + internal partial interface IAmountWithExchangeRateInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal + { + /// The exchange rate. + decimal? ExchangeRate { get; set; } + /// The exchange rate month. + int? ExchangeRateMonth { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/AmountWithExchangeRate.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/AmountWithExchangeRate.json.cs new file mode 100644 index 000000000000..06bd999abfb7 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/AmountWithExchangeRate.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The amount with exchange rate. + public partial class AmountWithExchangeRate + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal AmountWithExchangeRate(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __amount = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount(json); + {_exchangeRate = If( json?.PropertyT("exchangeRate"), out var __jsonExchangeRate) ? (decimal?)__jsonExchangeRate : ExchangeRate;} + {_exchangeRateMonth = If( json?.PropertyT("exchangeRateMonth"), out var __jsonExchangeRateMonth) ? (int?)__jsonExchangeRateMonth : ExchangeRateMonth;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new AmountWithExchangeRate(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __amount?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._exchangeRate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._exchangeRate) : null, "exchangeRate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._exchangeRateMonth ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((int)this._exchangeRateMonth) : null, "exchangeRateMonth" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Balance.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Balance.PowerShell.cs new file mode 100644 index 000000000000..7179801230b1 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Balance.PowerShell.cs @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// A balance resource. + [System.ComponentModel.TypeConverter(typeof(BalanceTypeConverter))] + public partial class Balance + { + + /// + /// 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 Balance(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.Consumption.Models.Api20211001.IBalanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).BillingFrequency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency?) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).BillingFrequency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency.CreateFrom); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("BeginningBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).BeginningBalance = (decimal?) content.GetValueForProperty("BeginningBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).BeginningBalance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EndingBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).EndingBalance = (decimal?) content.GetValueForProperty("EndingBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).EndingBalance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NewPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).NewPurchase = (decimal?) content.GetValueForProperty("NewPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).NewPurchase, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Adjustment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Adjustment = (decimal?) content.GetValueForProperty("Adjustment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Adjustment, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Utilized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Utilized = (decimal?) content.GetValueForProperty("Utilized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Utilized, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ServiceOverage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).ServiceOverage = (decimal?) content.GetValueForProperty("ServiceOverage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).ServiceOverage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).ChargesBilledSeparately = (decimal?) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).ChargesBilledSeparately, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalOverage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).TotalOverage = (decimal?) content.GetValueForProperty("TotalOverage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).TotalOverage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalUsage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).TotalUsage = (decimal?) content.GetValueForProperty("TotalUsage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).TotalUsage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AzureMarketplaceServiceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).AzureMarketplaceServiceCharge = (decimal?) content.GetValueForProperty("AzureMarketplaceServiceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).AzureMarketplaceServiceCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PriceHidden")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).PriceHidden = (bool?) content.GetValueForProperty("PriceHidden",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).PriceHidden, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NewPurchasesDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).NewPurchasesDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[]) content.GetValueForProperty("NewPurchasesDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).NewPurchasesDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesNewPurchasesDetailsItemTypeConverter.ConvertFrom)); + } + if (content.Contains("AdjustmentDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).AdjustmentDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[]) content.GetValueForProperty("AdjustmentDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).AdjustmentDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesAdjustmentDetailsItemTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Balance(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.Consumption.Models.Api20211001.IBalanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).BillingFrequency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency?) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).BillingFrequency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency.CreateFrom); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("BeginningBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).BeginningBalance = (decimal?) content.GetValueForProperty("BeginningBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).BeginningBalance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EndingBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).EndingBalance = (decimal?) content.GetValueForProperty("EndingBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).EndingBalance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NewPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).NewPurchase = (decimal?) content.GetValueForProperty("NewPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).NewPurchase, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Adjustment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Adjustment = (decimal?) content.GetValueForProperty("Adjustment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Adjustment, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Utilized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Utilized = (decimal?) content.GetValueForProperty("Utilized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).Utilized, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ServiceOverage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).ServiceOverage = (decimal?) content.GetValueForProperty("ServiceOverage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).ServiceOverage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).ChargesBilledSeparately = (decimal?) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).ChargesBilledSeparately, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalOverage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).TotalOverage = (decimal?) content.GetValueForProperty("TotalOverage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).TotalOverage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalUsage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).TotalUsage = (decimal?) content.GetValueForProperty("TotalUsage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).TotalUsage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AzureMarketplaceServiceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).AzureMarketplaceServiceCharge = (decimal?) content.GetValueForProperty("AzureMarketplaceServiceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).AzureMarketplaceServiceCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PriceHidden")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).PriceHidden = (bool?) content.GetValueForProperty("PriceHidden",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).PriceHidden, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NewPurchasesDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).NewPurchasesDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[]) content.GetValueForProperty("NewPurchasesDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).NewPurchasesDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesNewPurchasesDetailsItemTypeConverter.ConvertFrom)); + } + if (content.Contains("AdjustmentDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).AdjustmentDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[]) content.GetValueForProperty("AdjustmentDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal)this).AdjustmentDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesAdjustmentDetailsItemTypeConverter.ConvertFrom)); + } + 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.Consumption.Models.Api20211001.IBalance DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Balance(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.Consumption.Models.Api20211001.IBalance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Balance(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.Consumption.Models.Api20211001.IBalance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A balance resource. + [System.ComponentModel.TypeConverter(typeof(BalanceTypeConverter))] + public partial interface IBalance + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Balance.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Balance.TypeConverter.cs new file mode 100644 index 000000000000..a3b371fc12c6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Balance.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BalanceTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBalance ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Balance.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Balance.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Balance.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/consumption/generated/api/Models/Api20211001/Balance.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Balance.cs new file mode 100644 index 000000000000..f1f826b26342 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Balance.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A balance resource. + public partial class Balance : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(); + + /// Total adjustment amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? Adjustment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).Adjustment; } + + /// List of Adjustments (Promo credit, SIE credit etc.). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[] AdjustmentDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).AdjustmentDetail; } + + /// Total charges for Azure Marketplace. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AzureMarketplaceServiceCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).AzureMarketplaceServiceCharge; } + + /// The beginning balance for the billing period. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? BeginningBalance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).BeginningBalance; } + + /// The billing frequency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency? BillingFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).BillingFrequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).BillingFrequency = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency)""); } + + /// Charges Billed separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ChargesBilledSeparately { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).ChargesBilledSeparately; } + + /// The ISO currency in which the meter is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).Currency; } + + /// + /// The ending balance for the billing period (for open periods this will be updated daily). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? EndingBalance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).EndingBalance; } + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Adjustment + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.Adjustment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).Adjustment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).Adjustment = value; } + + /// Internal Acessors for AdjustmentDetail + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.AdjustmentDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).AdjustmentDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).AdjustmentDetail = value; } + + /// Internal Acessors for AzureMarketplaceServiceCharge + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.AzureMarketplaceServiceCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).AzureMarketplaceServiceCharge; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).AzureMarketplaceServiceCharge = value; } + + /// Internal Acessors for BeginningBalance + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.BeginningBalance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).BeginningBalance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).BeginningBalance = value; } + + /// Internal Acessors for ChargesBilledSeparately + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.ChargesBilledSeparately { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).ChargesBilledSeparately; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).ChargesBilledSeparately = value; } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).Currency = value; } + + /// Internal Acessors for EndingBalance + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.EndingBalance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).EndingBalance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).EndingBalance = value; } + + /// Internal Acessors for NewPurchase + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.NewPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).NewPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).NewPurchase = value; } + + /// Internal Acessors for NewPurchasesDetail + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.NewPurchasesDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).NewPurchasesDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).NewPurchasesDetail = value; } + + /// Internal Acessors for PriceHidden + bool? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.PriceHidden { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).PriceHidden; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).PriceHidden = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalanceProperties()); set { {_property = value;} } } + + /// Internal Acessors for ServiceOverage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.ServiceOverage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).ServiceOverage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).ServiceOverage = value; } + + /// Internal Acessors for TotalOverage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.TotalOverage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).TotalOverage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).TotalOverage = value; } + + /// Internal Acessors for TotalUsage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.TotalUsage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).TotalUsage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).TotalUsage = value; } + + /// Internal Acessors for Utilized + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceInternal.Utilized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).Utilized; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).Utilized = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// Total new purchase amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? NewPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).NewPurchase; } + + /// List of new purchases. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[] NewPurchasesDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).NewPurchasesDetail; } + + /// Price is hidden or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public bool? PriceHidden { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).PriceHidden; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceProperties _property; + + /// The properties of the balance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalanceProperties()); set => this._property = value; } + + /// Overage for Azure services. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ServiceOverage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).ServiceOverage; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// serviceOverage + chargesBilledSeparately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? TotalOverage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).TotalOverage; } + + /// Azure service commitment + total Overage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? TotalUsage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).TotalUsage; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// Total Commitment usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? Utilized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)Property).Utilized; } + + /// Creates an new instance. + public Balance() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// A balance resource. + public partial interface IBalance : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource + { + /// Total adjustment amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total adjustment amount.", + SerializedName = @"adjustments", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Adjustment { get; } + /// List of Adjustments (Promo credit, SIE credit etc.). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of Adjustments (Promo credit, SIE credit etc.).", + SerializedName = @"adjustmentDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[] AdjustmentDetail { get; } + /// Total charges for Azure Marketplace. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total charges for Azure Marketplace.", + SerializedName = @"azureMarketplaceServiceCharges", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AzureMarketplaceServiceCharge { get; } + /// The beginning balance for the billing period. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The beginning balance for the billing period.", + SerializedName = @"beginningBalance", + PossibleTypes = new [] { typeof(decimal) })] + decimal? BeginningBalance { get; } + /// The billing frequency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The billing frequency.", + SerializedName = @"billingFrequency", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency? BillingFrequency { get; set; } + /// Charges Billed separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Charges Billed separately.", + SerializedName = @"chargesBilledSeparately", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargesBilledSeparately { get; } + /// The ISO currency in which the meter is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ISO currency in which the meter is charged, for example, USD.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// + /// The ending balance for the billing period (for open periods this will be updated daily). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ending balance for the billing period (for open periods this will be updated daily).", + SerializedName = @"endingBalance", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EndingBalance { get; } + /// Total new purchase amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total new purchase amount.", + SerializedName = @"newPurchases", + PossibleTypes = new [] { typeof(decimal) })] + decimal? NewPurchase { get; } + /// List of new purchases. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of new purchases.", + SerializedName = @"newPurchasesDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[] NewPurchasesDetail { get; } + /// Price is hidden or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Price is hidden or not.", + SerializedName = @"priceHidden", + PossibleTypes = new [] { typeof(bool) })] + bool? PriceHidden { get; } + /// Overage for Azure services. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Overage for Azure services.", + SerializedName = @"serviceOverage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ServiceOverage { get; } + /// serviceOverage + chargesBilledSeparately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"serviceOverage + chargesBilledSeparately.", + SerializedName = @"totalOverage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalOverage { get; } + /// Azure service commitment + total Overage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure service commitment + total Overage.", + SerializedName = @"totalUsage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalUsage { get; } + /// Total Commitment usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total Commitment usage.", + SerializedName = @"utilized", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Utilized { get; } + + } + /// A balance resource. + internal partial interface IBalanceInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal + { + /// Total adjustment amount. + decimal? Adjustment { get; set; } + /// List of Adjustments (Promo credit, SIE credit etc.). + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[] AdjustmentDetail { get; set; } + /// Total charges for Azure Marketplace. + decimal? AzureMarketplaceServiceCharge { get; set; } + /// The beginning balance for the billing period. + decimal? BeginningBalance { get; set; } + /// The billing frequency. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency? BillingFrequency { get; set; } + /// Charges Billed separately. + decimal? ChargesBilledSeparately { get; set; } + /// The ISO currency in which the meter is charged, for example, USD. + string Currency { get; set; } + /// + /// The ending balance for the billing period (for open periods this will be updated daily). + /// + decimal? EndingBalance { get; set; } + /// Total new purchase amount. + decimal? NewPurchase { get; set; } + /// List of new purchases. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[] NewPurchasesDetail { get; set; } + /// Price is hidden or not. + bool? PriceHidden { get; set; } + /// The properties of the balance. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceProperties Property { get; set; } + /// Overage for Azure services. + decimal? ServiceOverage { get; set; } + /// serviceOverage + chargesBilledSeparately. + decimal? TotalOverage { get; set; } + /// Azure service commitment + total Overage. + decimal? TotalUsage { get; set; } + /// Total Commitment usage. + decimal? Utilized { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Balance.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Balance.json.cs new file mode 100644 index 000000000000..8cff526894fc --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Balance.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A balance resource. + public partial class Balance + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal Balance(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalanceProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new Balance(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/BalanceProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BalanceProperties.PowerShell.cs new file mode 100644 index 000000000000..c0a46bfefd37 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BalanceProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the balance. + [System.ComponentModel.TypeConverter(typeof(BalancePropertiesTypeConverter))] + public partial class BalanceProperties + { + + /// + /// 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 BalanceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("BeginningBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).BeginningBalance = (decimal?) content.GetValueForProperty("BeginningBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).BeginningBalance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EndingBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).EndingBalance = (decimal?) content.GetValueForProperty("EndingBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).EndingBalance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NewPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).NewPurchase = (decimal?) content.GetValueForProperty("NewPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).NewPurchase, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Adjustment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).Adjustment = (decimal?) content.GetValueForProperty("Adjustment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).Adjustment, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Utilized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).Utilized = (decimal?) content.GetValueForProperty("Utilized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).Utilized, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ServiceOverage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).ServiceOverage = (decimal?) content.GetValueForProperty("ServiceOverage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).ServiceOverage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).ChargesBilledSeparately = (decimal?) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).ChargesBilledSeparately, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalOverage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).TotalOverage = (decimal?) content.GetValueForProperty("TotalOverage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).TotalOverage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalUsage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).TotalUsage = (decimal?) content.GetValueForProperty("TotalUsage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).TotalUsage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AzureMarketplaceServiceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).AzureMarketplaceServiceCharge = (decimal?) content.GetValueForProperty("AzureMarketplaceServiceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).AzureMarketplaceServiceCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).BillingFrequency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency?) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).BillingFrequency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency.CreateFrom); + } + if (content.Contains("PriceHidden")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).PriceHidden = (bool?) content.GetValueForProperty("PriceHidden",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).PriceHidden, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NewPurchasesDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).NewPurchasesDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[]) content.GetValueForProperty("NewPurchasesDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).NewPurchasesDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesNewPurchasesDetailsItemTypeConverter.ConvertFrom)); + } + if (content.Contains("AdjustmentDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).AdjustmentDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[]) content.GetValueForProperty("AdjustmentDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).AdjustmentDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesAdjustmentDetailsItemTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BalanceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("BeginningBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).BeginningBalance = (decimal?) content.GetValueForProperty("BeginningBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).BeginningBalance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EndingBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).EndingBalance = (decimal?) content.GetValueForProperty("EndingBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).EndingBalance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NewPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).NewPurchase = (decimal?) content.GetValueForProperty("NewPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).NewPurchase, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Adjustment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).Adjustment = (decimal?) content.GetValueForProperty("Adjustment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).Adjustment, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Utilized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).Utilized = (decimal?) content.GetValueForProperty("Utilized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).Utilized, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ServiceOverage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).ServiceOverage = (decimal?) content.GetValueForProperty("ServiceOverage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).ServiceOverage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).ChargesBilledSeparately = (decimal?) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).ChargesBilledSeparately, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalOverage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).TotalOverage = (decimal?) content.GetValueForProperty("TotalOverage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).TotalOverage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalUsage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).TotalUsage = (decimal?) content.GetValueForProperty("TotalUsage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).TotalUsage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AzureMarketplaceServiceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).AzureMarketplaceServiceCharge = (decimal?) content.GetValueForProperty("AzureMarketplaceServiceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).AzureMarketplaceServiceCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).BillingFrequency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency?) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).BillingFrequency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency.CreateFrom); + } + if (content.Contains("PriceHidden")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).PriceHidden = (bool?) content.GetValueForProperty("PriceHidden",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).PriceHidden, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NewPurchasesDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).NewPurchasesDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[]) content.GetValueForProperty("NewPurchasesDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).NewPurchasesDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesNewPurchasesDetailsItemTypeConverter.ConvertFrom)); + } + if (content.Contains("AdjustmentDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).AdjustmentDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[]) content.GetValueForProperty("AdjustmentDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal)this).AdjustmentDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesAdjustmentDetailsItemTypeConverter.ConvertFrom)); + } + 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.Consumption.Models.Api20211001.IBalanceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BalanceProperties(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.Consumption.Models.Api20211001.IBalanceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BalanceProperties(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.Consumption.Models.Api20211001.IBalanceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the balance. + [System.ComponentModel.TypeConverter(typeof(BalancePropertiesTypeConverter))] + public partial interface IBalanceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BalanceProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BalanceProperties.TypeConverter.cs new file mode 100644 index 000000000000..16e972ca69a3 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BalanceProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BalancePropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBalanceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BalanceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BalanceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BalanceProperties.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/consumption/generated/api/Models/Api20211001/BalanceProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BalanceProperties.cs new file mode 100644 index 000000000000..b9c446684351 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BalanceProperties.cs @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the balance. + public partial class BalanceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal + { + + /// Backing field for property. + private decimal? _adjustment; + + /// Total adjustment amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Adjustment { get => this._adjustment; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[] _adjustmentDetail; + + /// List of Adjustments (Promo credit, SIE credit etc.). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[] AdjustmentDetail { get => this._adjustmentDetail; } + + /// Backing field for property. + private decimal? _azureMarketplaceServiceCharge; + + /// Total charges for Azure Marketplace. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? AzureMarketplaceServiceCharge { get => this._azureMarketplaceServiceCharge; } + + /// Backing field for property. + private decimal? _beginningBalance; + + /// The beginning balance for the billing period. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? BeginningBalance { get => this._beginningBalance; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency? _billingFrequency; + + /// The billing frequency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency? BillingFrequency { get => this._billingFrequency; set => this._billingFrequency = value; } + + /// Backing field for property. + private decimal? _chargesBilledSeparately; + + /// Charges Billed separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? ChargesBilledSeparately { get => this._chargesBilledSeparately; } + + /// Backing field for property. + private string _currency; + + /// The ISO currency in which the meter is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Currency { get => this._currency; } + + /// Backing field for property. + private decimal? _endingBalance; + + /// + /// The ending balance for the billing period (for open periods this will be updated daily). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? EndingBalance { get => this._endingBalance; } + + /// Internal Acessors for Adjustment + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.Adjustment { get => this._adjustment; set { {_adjustment = value;} } } + + /// Internal Acessors for AdjustmentDetail + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.AdjustmentDetail { get => this._adjustmentDetail; set { {_adjustmentDetail = value;} } } + + /// Internal Acessors for AzureMarketplaceServiceCharge + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.AzureMarketplaceServiceCharge { get => this._azureMarketplaceServiceCharge; set { {_azureMarketplaceServiceCharge = value;} } } + + /// Internal Acessors for BeginningBalance + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.BeginningBalance { get => this._beginningBalance; set { {_beginningBalance = value;} } } + + /// Internal Acessors for ChargesBilledSeparately + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.ChargesBilledSeparately { get => this._chargesBilledSeparately; set { {_chargesBilledSeparately = value;} } } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.Currency { get => this._currency; set { {_currency = value;} } } + + /// Internal Acessors for EndingBalance + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.EndingBalance { get => this._endingBalance; set { {_endingBalance = value;} } } + + /// Internal Acessors for NewPurchase + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.NewPurchase { get => this._newPurchase; set { {_newPurchase = value;} } } + + /// Internal Acessors for NewPurchasesDetail + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.NewPurchasesDetail { get => this._newPurchasesDetail; set { {_newPurchasesDetail = value;} } } + + /// Internal Acessors for PriceHidden + bool? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.PriceHidden { get => this._priceHidden; set { {_priceHidden = value;} } } + + /// Internal Acessors for ServiceOverage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.ServiceOverage { get => this._serviceOverage; set { {_serviceOverage = value;} } } + + /// Internal Acessors for TotalOverage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.TotalOverage { get => this._totalOverage; set { {_totalOverage = value;} } } + + /// Internal Acessors for TotalUsage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.TotalUsage { get => this._totalUsage; set { {_totalUsage = value;} } } + + /// Internal Acessors for Utilized + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesInternal.Utilized { get => this._utilized; set { {_utilized = value;} } } + + /// Backing field for property. + private decimal? _newPurchase; + + /// Total new purchase amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? NewPurchase { get => this._newPurchase; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[] _newPurchasesDetail; + + /// List of new purchases. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[] NewPurchasesDetail { get => this._newPurchasesDetail; } + + /// Backing field for property. + private bool? _priceHidden; + + /// Price is hidden or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public bool? PriceHidden { get => this._priceHidden; } + + /// Backing field for property. + private decimal? _serviceOverage; + + /// Overage for Azure services. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? ServiceOverage { get => this._serviceOverage; } + + /// Backing field for property. + private decimal? _totalOverage; + + /// serviceOverage + chargesBilledSeparately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? TotalOverage { get => this._totalOverage; } + + /// Backing field for property. + private decimal? _totalUsage; + + /// Azure service commitment + total Overage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? TotalUsage { get => this._totalUsage; } + + /// Backing field for property. + private decimal? _utilized; + + /// Total Commitment usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Utilized { get => this._utilized; } + + /// Creates an new instance. + public BalanceProperties() + { + + } + } + /// The properties of the balance. + public partial interface IBalanceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Total adjustment amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total adjustment amount.", + SerializedName = @"adjustments", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Adjustment { get; } + /// List of Adjustments (Promo credit, SIE credit etc.). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of Adjustments (Promo credit, SIE credit etc.).", + SerializedName = @"adjustmentDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[] AdjustmentDetail { get; } + /// Total charges for Azure Marketplace. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total charges for Azure Marketplace.", + SerializedName = @"azureMarketplaceServiceCharges", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AzureMarketplaceServiceCharge { get; } + /// The beginning balance for the billing period. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The beginning balance for the billing period.", + SerializedName = @"beginningBalance", + PossibleTypes = new [] { typeof(decimal) })] + decimal? BeginningBalance { get; } + /// The billing frequency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The billing frequency.", + SerializedName = @"billingFrequency", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency? BillingFrequency { get; set; } + /// Charges Billed separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Charges Billed separately.", + SerializedName = @"chargesBilledSeparately", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargesBilledSeparately { get; } + /// The ISO currency in which the meter is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ISO currency in which the meter is charged, for example, USD.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// + /// The ending balance for the billing period (for open periods this will be updated daily). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ending balance for the billing period (for open periods this will be updated daily).", + SerializedName = @"endingBalance", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EndingBalance { get; } + /// Total new purchase amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total new purchase amount.", + SerializedName = @"newPurchases", + PossibleTypes = new [] { typeof(decimal) })] + decimal? NewPurchase { get; } + /// List of new purchases. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of new purchases.", + SerializedName = @"newPurchasesDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[] NewPurchasesDetail { get; } + /// Price is hidden or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Price is hidden or not.", + SerializedName = @"priceHidden", + PossibleTypes = new [] { typeof(bool) })] + bool? PriceHidden { get; } + /// Overage for Azure services. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Overage for Azure services.", + SerializedName = @"serviceOverage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ServiceOverage { get; } + /// serviceOverage + chargesBilledSeparately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"serviceOverage + chargesBilledSeparately.", + SerializedName = @"totalOverage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalOverage { get; } + /// Azure service commitment + total Overage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure service commitment + total Overage.", + SerializedName = @"totalUsage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalUsage { get; } + /// Total Commitment usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total Commitment usage.", + SerializedName = @"utilized", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Utilized { get; } + + } + /// The properties of the balance. + internal partial interface IBalancePropertiesInternal + + { + /// Total adjustment amount. + decimal? Adjustment { get; set; } + /// List of Adjustments (Promo credit, SIE credit etc.). + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem[] AdjustmentDetail { get; set; } + /// Total charges for Azure Marketplace. + decimal? AzureMarketplaceServiceCharge { get; set; } + /// The beginning balance for the billing period. + decimal? BeginningBalance { get; set; } + /// The billing frequency. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency? BillingFrequency { get; set; } + /// Charges Billed separately. + decimal? ChargesBilledSeparately { get; set; } + /// The ISO currency in which the meter is charged, for example, USD. + string Currency { get; set; } + /// + /// The ending balance for the billing period (for open periods this will be updated daily). + /// + decimal? EndingBalance { get; set; } + /// Total new purchase amount. + decimal? NewPurchase { get; set; } + /// List of new purchases. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem[] NewPurchasesDetail { get; set; } + /// Price is hidden or not. + bool? PriceHidden { get; set; } + /// Overage for Azure services. + decimal? ServiceOverage { get; set; } + /// serviceOverage + chargesBilledSeparately. + decimal? TotalOverage { get; set; } + /// Azure service commitment + total Overage. + decimal? TotalUsage { get; set; } + /// Total Commitment usage. + decimal? Utilized { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BalanceProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BalanceProperties.json.cs new file mode 100644 index 000000000000..7cdbf1f56da0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BalanceProperties.json.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the balance. + public partial class BalanceProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal BalanceProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_currency = If( json?.PropertyT("currency"), out var __jsonCurrency) ? (string)__jsonCurrency : (string)Currency;} + {_beginningBalance = If( json?.PropertyT("beginningBalance"), out var __jsonBeginningBalance) ? (decimal?)__jsonBeginningBalance : BeginningBalance;} + {_endingBalance = If( json?.PropertyT("endingBalance"), out var __jsonEndingBalance) ? (decimal?)__jsonEndingBalance : EndingBalance;} + {_newPurchase = If( json?.PropertyT("newPurchases"), out var __jsonNewPurchases) ? (decimal?)__jsonNewPurchases : NewPurchase;} + {_adjustment = If( json?.PropertyT("adjustments"), out var __jsonAdjustments) ? (decimal?)__jsonAdjustments : Adjustment;} + {_utilized = If( json?.PropertyT("utilized"), out var __jsonUtilized) ? (decimal?)__jsonUtilized : Utilized;} + {_serviceOverage = If( json?.PropertyT("serviceOverage"), out var __jsonServiceOverage) ? (decimal?)__jsonServiceOverage : ServiceOverage;} + {_chargesBilledSeparately = If( json?.PropertyT("chargesBilledSeparately"), out var __jsonChargesBilledSeparately) ? (decimal?)__jsonChargesBilledSeparately : ChargesBilledSeparately;} + {_totalOverage = If( json?.PropertyT("totalOverage"), out var __jsonTotalOverage) ? (decimal?)__jsonTotalOverage : TotalOverage;} + {_totalUsage = If( json?.PropertyT("totalUsage"), out var __jsonTotalUsage) ? (decimal?)__jsonTotalUsage : TotalUsage;} + {_azureMarketplaceServiceCharge = If( json?.PropertyT("azureMarketplaceServiceCharges"), out var __jsonAzureMarketplaceServiceCharges) ? (decimal?)__jsonAzureMarketplaceServiceCharges : AzureMarketplaceServiceCharge;} + {_billingFrequency = If( json?.PropertyT("billingFrequency"), out var __jsonBillingFrequency) ? (string)__jsonBillingFrequency : (string)BillingFrequency;} + {_priceHidden = If( json?.PropertyT("priceHidden"), out var __jsonPriceHidden) ? (bool?)__jsonPriceHidden : PriceHidden;} + {_newPurchasesDetail = If( json?.PropertyT("newPurchasesDetails"), out var __jsonNewPurchasesDetails) ? If( __jsonNewPurchasesDetails as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesNewPurchasesDetailsItem.FromJson(__u) )) ))() : null : NewPurchasesDetail;} + {_adjustmentDetail = If( json?.PropertyT("adjustmentDetails"), out var __jsonAdjustmentDetails) ? If( __jsonAdjustmentDetails as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BalancePropertiesAdjustmentDetailsItem.FromJson(__p) )) ))() : null : AdjustmentDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalanceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new BalanceProperties(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._currency.ToString()) : null, "currency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._beginningBalance ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._beginningBalance) : null, "beginningBalance" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endingBalance ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._endingBalance) : null, "endingBalance" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._newPurchase ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._newPurchase) : null, "newPurchases" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._adjustment ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._adjustment) : null, "adjustments" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._utilized ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._utilized) : null, "utilized" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._serviceOverage ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._serviceOverage) : null, "serviceOverage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._chargesBilledSeparately ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._chargesBilledSeparately) : null, "chargesBilledSeparately" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalOverage ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._totalOverage) : null, "totalOverage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalUsage ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._totalUsage) : null, "totalUsage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._azureMarketplaceServiceCharge ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._azureMarketplaceServiceCharge) : null, "azureMarketplaceServiceCharges" ,container.Add ); + } + AddIf( null != (((object)this._billingFrequency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingFrequency.ToString()) : null, "billingFrequency" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._priceHidden ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonBoolean((bool)this._priceHidden) : null, "priceHidden" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._newPurchasesDetail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._newPurchasesDetail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("newPurchasesDetails",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._adjustmentDetail) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __s in this._adjustmentDetail ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("adjustmentDetails",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesAdjustmentDetailsItem.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesAdjustmentDetailsItem.PowerShell.cs new file mode 100644 index 000000000000..90956bea18d0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesAdjustmentDetailsItem.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(BalancePropertiesAdjustmentDetailsItemTypeConverter))] + public partial class BalancePropertiesAdjustmentDetailsItem + { + + /// + /// 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 BalancePropertiesAdjustmentDetailsItem(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.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItemInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItemInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItemInternal)this).Value = (decimal?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItemInternal)this).Value, (__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 BalancePropertiesAdjustmentDetailsItem(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.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItemInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItemInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItemInternal)this).Value = (decimal?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItemInternal)this).Value, (__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.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BalancePropertiesAdjustmentDetailsItem(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.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BalancePropertiesAdjustmentDetailsItem(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.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(BalancePropertiesAdjustmentDetailsItemTypeConverter))] + public partial interface IBalancePropertiesAdjustmentDetailsItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesAdjustmentDetailsItem.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesAdjustmentDetailsItem.TypeConverter.cs new file mode 100644 index 000000000000..378b85cc73a2 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesAdjustmentDetailsItem.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BalancePropertiesAdjustmentDetailsItemTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BalancePropertiesAdjustmentDetailsItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BalancePropertiesAdjustmentDetailsItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BalancePropertiesAdjustmentDetailsItem.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/consumption/generated/api/Models/Api20211001/BalancePropertiesAdjustmentDetailsItem.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesAdjustmentDetailsItem.cs new file mode 100644 index 000000000000..d0c628cddbe2 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesAdjustmentDetailsItem.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + public partial class BalancePropertiesAdjustmentDetailsItem : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItemInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItemInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Value + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItemInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _name; + + /// the name of new adjustment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private decimal? _value; + + /// the value of new adjustment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Value { get => this._value; } + + /// Creates an new instance. + public BalancePropertiesAdjustmentDetailsItem() + { + + } + } + public partial interface IBalancePropertiesAdjustmentDetailsItem : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// the name of new adjustment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"the name of new adjustment.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// the value of new adjustment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"the value of new adjustment.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Value { get; } + + } + internal partial interface IBalancePropertiesAdjustmentDetailsItemInternal + + { + /// the name of new adjustment. + string Name { get; set; } + /// the value of new adjustment. + decimal? Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesAdjustmentDetailsItem.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesAdjustmentDetailsItem.json.cs new file mode 100644 index 000000000000..9ee7099150bf --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesAdjustmentDetailsItem.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + public partial class BalancePropertiesAdjustmentDetailsItem + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal BalancePropertiesAdjustmentDetailsItem(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (decimal?)__jsonValue : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesAdjustmentDetailsItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new BalancePropertiesAdjustmentDetailsItem(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._value) : null, "value" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesNewPurchasesDetailsItem.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesNewPurchasesDetailsItem.PowerShell.cs new file mode 100644 index 000000000000..1bd6e3c10438 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesNewPurchasesDetailsItem.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(BalancePropertiesNewPurchasesDetailsItemTypeConverter))] + public partial class BalancePropertiesNewPurchasesDetailsItem + { + + /// + /// 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 BalancePropertiesNewPurchasesDetailsItem(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.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItemInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItemInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItemInternal)this).Value = (decimal?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItemInternal)this).Value, (__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 BalancePropertiesNewPurchasesDetailsItem(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.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItemInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItemInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItemInternal)this).Value = (decimal?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItemInternal)this).Value, (__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.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BalancePropertiesNewPurchasesDetailsItem(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.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BalancePropertiesNewPurchasesDetailsItem(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.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(BalancePropertiesNewPurchasesDetailsItemTypeConverter))] + public partial interface IBalancePropertiesNewPurchasesDetailsItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesNewPurchasesDetailsItem.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesNewPurchasesDetailsItem.TypeConverter.cs new file mode 100644 index 000000000000..026b43767307 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesNewPurchasesDetailsItem.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BalancePropertiesNewPurchasesDetailsItemTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BalancePropertiesNewPurchasesDetailsItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BalancePropertiesNewPurchasesDetailsItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BalancePropertiesNewPurchasesDetailsItem.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/consumption/generated/api/Models/Api20211001/BalancePropertiesNewPurchasesDetailsItem.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesNewPurchasesDetailsItem.cs new file mode 100644 index 000000000000..910e5a7b14b0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesNewPurchasesDetailsItem.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + public partial class BalancePropertiesNewPurchasesDetailsItem : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItemInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItemInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Value + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItemInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _name; + + /// the name of new purchase. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private decimal? _value; + + /// the value of new purchase. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Value { get => this._value; } + + /// + /// Creates an new instance. + /// + public BalancePropertiesNewPurchasesDetailsItem() + { + + } + } + public partial interface IBalancePropertiesNewPurchasesDetailsItem : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// the name of new purchase. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"the name of new purchase.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// the value of new purchase. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"the value of new purchase.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Value { get; } + + } + internal partial interface IBalancePropertiesNewPurchasesDetailsItemInternal + + { + /// the name of new purchase. + string Name { get; set; } + /// the value of new purchase. + decimal? Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesNewPurchasesDetailsItem.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesNewPurchasesDetailsItem.json.cs new file mode 100644 index 000000000000..8d9830bf5f9a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BalancePropertiesNewPurchasesDetailsItem.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + public partial class BalancePropertiesNewPurchasesDetailsItem + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal BalancePropertiesNewPurchasesDetailsItem(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (decimal?)__jsonValue : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalancePropertiesNewPurchasesDetailsItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new BalancePropertiesNewPurchasesDetailsItem(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._value) : null, "value" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Budget.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Budget.PowerShell.cs new file mode 100644 index 000000000000..381653504007 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Budget.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// A budget resource. + [System.ComponentModel.TypeConverter(typeof(BudgetTypeConverter))] + public partial class Budget + { + + /// + /// 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 Budget(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.Consumption.Models.Api20211001.IBudgetInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("CurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).CurrentSpend = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend) content.GetValueForProperty("CurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).CurrentSpend, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CurrentSpendTypeConverter.ConvertFrom); + } + if (content.Contains("ForecastSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).ForecastSpend = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend) content.GetValueForProperty("ForecastSpend",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).ForecastSpend, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ForecastSpendTypeConverter.ConvertFrom); + } + if (content.Contains("TimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Amount = (decimal) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TimeGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimeGrain = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimeGrain, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType.CreateFrom); + } + if (content.Contains("Notification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Notification = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Notification, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetPropertiesNotificationsTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentSpendAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).CurrentSpendAmount = (decimal?) content.GetValueForProperty("CurrentSpendAmount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).CurrentSpendAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CurrentSpendUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).CurrentSpendUnit = (string) content.GetValueForProperty("CurrentSpendUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).CurrentSpendUnit, global::System.Convert.ToString); + } + if (content.Contains("ForecastSpendAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).ForecastSpendAmount = (decimal?) content.GetValueForProperty("ForecastSpendAmount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).ForecastSpendAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ForecastSpendUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).ForecastSpendUnit = (string) content.GetValueForProperty("ForecastSpendUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).ForecastSpendUnit, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimePeriodStartDate = (global::System.DateTime) content.GetValueForProperty("TimePeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimePeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimePeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("TimePeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimePeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilterPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)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 Budget(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.Consumption.Models.Api20211001.IBudgetInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("CurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).CurrentSpend = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend) content.GetValueForProperty("CurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).CurrentSpend, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CurrentSpendTypeConverter.ConvertFrom); + } + if (content.Contains("ForecastSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).ForecastSpend = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend) content.GetValueForProperty("ForecastSpend",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).ForecastSpend, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ForecastSpendTypeConverter.ConvertFrom); + } + if (content.Contains("TimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Amount = (decimal) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TimeGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimeGrain = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimeGrain, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType.CreateFrom); + } + if (content.Contains("Notification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Notification = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).Notification, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetPropertiesNotificationsTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentSpendAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).CurrentSpendAmount = (decimal?) content.GetValueForProperty("CurrentSpendAmount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).CurrentSpendAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CurrentSpendUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).CurrentSpendUnit = (string) content.GetValueForProperty("CurrentSpendUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).CurrentSpendUnit, global::System.Convert.ToString); + } + if (content.Contains("ForecastSpendAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).ForecastSpendAmount = (decimal?) content.GetValueForProperty("ForecastSpendAmount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).ForecastSpendAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ForecastSpendUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).ForecastSpendUnit = (string) content.GetValueForProperty("ForecastSpendUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).ForecastSpendUnit, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimePeriodStartDate = (global::System.DateTime) content.GetValueForProperty("TimePeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimePeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimePeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("TimePeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TimePeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilterPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal)this).TagValue, __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.Consumption.Models.Api20211001.IBudget DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Budget(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.Consumption.Models.Api20211001.IBudget DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Budget(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.Consumption.Models.Api20211001.IBudget FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A budget resource. + [System.ComponentModel.TypeConverter(typeof(BudgetTypeConverter))] + public partial interface IBudget + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Budget.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Budget.TypeConverter.cs new file mode 100644 index 000000000000..d7d8af6ab820 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Budget.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BudgetTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBudget ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Budget.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Budget.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Budget.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/consumption/generated/api/Models/Api20211001/Budget.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Budget.cs new file mode 100644 index 000000000000..26c6c3091e9d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Budget.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A budget resource. + public partial class Budget : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ProxyResource(); + + /// The total amount of cost to track with the budget + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? Amount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).Amount = value ?? default(decimal); } + + /// The category of the budget, whether the budget tracks cost or usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).Category; } + + /// The total amount of cost which is being tracked by the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CurrentSpendAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).CurrentSpendAmount; } + + /// The unit of measure for the budget amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CurrentSpendUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).CurrentSpendUnit; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).DimensionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).DimensionName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).DimensionOperator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).DimensionValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).DimensionValue = value ?? null /* arrayOf */; } + + /// + /// 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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[] FilterAnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).FilterAnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).FilterAnd = value ?? null /* arrayOf */; } + + /// + /// The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the + /// budget contains a forecast alert type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ForecastSpendAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).ForecastSpendAmount; } + + /// The unit of measure for the budget amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ForecastSpendUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).ForecastSpendUnit; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + + /// Internal Acessors for Category + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).Category = value; } + + /// Internal Acessors for CurrentSpend + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.CurrentSpend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).CurrentSpend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).CurrentSpend = value; } + + /// Internal Acessors for CurrentSpendAmount + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.CurrentSpendAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).CurrentSpendAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).CurrentSpendAmount = value; } + + /// Internal Acessors for CurrentSpendUnit + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.CurrentSpendUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).CurrentSpendUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).CurrentSpendUnit = value; } + + /// Internal Acessors for DimensionOperator + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).DimensionOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).DimensionOperator = value; } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.Filter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).Filter = value; } + + /// Internal Acessors for FilterDimension + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.FilterDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).FilterDimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).FilterDimension = value; } + + /// Internal Acessors for FilterTag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.FilterTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).FilterTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).FilterTag = value; } + + /// Internal Acessors for ForecastSpend + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.ForecastSpend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).ForecastSpend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).ForecastSpend = value; } + + /// Internal Acessors for ForecastSpendAmount + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.ForecastSpendAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).ForecastSpendAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).ForecastSpendAmount = value; } + + /// Internal Acessors for ForecastSpendUnit + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.ForecastSpendUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).ForecastSpendUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).ForecastSpendUnit = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetProperties()); set { {_property = value;} } } + + /// Internal Acessors for TagOperator + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TagOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TagOperator = value; } + + /// Internal Acessors for TimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetInternal.TimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TimePeriod = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + + /// + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications Notification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).Notification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).Notification = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetProperties _property; + + /// The properties of the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetProperties()); set => this._property = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TagName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TagName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TagOperator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TagValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TagValue = value ?? null /* arrayOf */; } + + /// + /// The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, + /// and BillingAnnual are only supported by WD customers + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType? TimeGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TimeGrain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TimeGrain = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType)""); } + + /// + /// The end date for the budget. If not provided, we default this to 10 years from the start date. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TimePeriodEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TimePeriodEndDate = value ?? default(global::System.DateTime); } + + /// The start date for the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TimePeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)Property).TimePeriodStartDate = value ?? default(global::System.DateTime); } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public Budget() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// A budget resource. + public partial interface IBudget : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource + { + /// The total amount of cost to track with the budget + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total amount of cost to track with the budget", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Amount { get; set; } + /// The category of the budget, whether the budget tracks cost or usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The category of the budget, whether the budget tracks cost or usage.", + SerializedName = @"category", + PossibleTypes = new [] { typeof(string) })] + string Category { get; } + /// The total amount of cost which is being tracked by the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total amount of cost which is being tracked by the budget.", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CurrentSpendAmount { get; } + /// The unit of measure for the budget amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit of measure for the budget amount.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string CurrentSpendUnit { get; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBudgetFilterProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[] FilterAnd { get; set; } + /// + /// The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the + /// budget contains a forecast alert type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the budget contains a forecast alert type.", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ForecastSpendAmount { get; } + /// The unit of measure for the budget amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit of measure for the budget amount.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string ForecastSpendUnit { get; } + /// + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of notifications associated with the budget. Budget can have up to five notifications.", + SerializedName = @"notifications", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications Notification { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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 time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, + /// and BillingAnnual are only supported by WD customers + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers", + SerializedName = @"timeGrain", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType? TimeGrain { get; set; } + /// + /// The end date for the budget. If not provided, we default this to 10 years from the start date. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date for the budget. If not provided, we default this to 10 years from the start date.", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodEndDate { get; set; } + /// The start date for the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date for the budget.", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodStartDate { get; set; } + + } + /// A budget resource. + internal partial interface IBudgetInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal + { + /// The total amount of cost to track with the budget + decimal? Amount { get; set; } + /// The category of the budget, whether the budget tracks cost or usage. + string Category { get; set; } + /// The current amount of cost which is being tracked for a budget. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend CurrentSpend { get; set; } + /// The total amount of cost which is being tracked by the budget. + decimal? CurrentSpendAmount { get; set; } + /// The unit of measure for the budget amount. + string CurrentSpendUnit { 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; } + /// May be used to filter budgets by user-specified dimensions and/or tags. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter Filter { get; set; } + /// The logical "AND" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[] FilterAnd { get; set; } + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression FilterDimension { get; set; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression FilterTag { get; set; } + /// The forecasted cost which is being tracked for a budget. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend ForecastSpend { get; set; } + /// + /// The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the + /// budget contains a forecast alert type. + /// + decimal? ForecastSpendAmount { get; set; } + /// The unit of measure for the budget amount. + string ForecastSpendUnit { get; set; } + /// + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications Notification { get; set; } + /// The properties of the budget. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetProperties Property { 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; } + /// + /// The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, + /// and BillingAnnual are only supported by WD customers + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType? TimeGrain { get; set; } + /// + /// Has start and end date of the budget. The start date must be first of the month and should be less than the end date. + /// Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve months. Past start + /// date should be selected within the timegrain period. There are no restrictions on the end date. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod TimePeriod { get; set; } + /// + /// The end date for the budget. If not provided, we default this to 10 years from the start date. + /// + global::System.DateTime? TimePeriodEndDate { get; set; } + /// The start date for the budget. + global::System.DateTime? TimePeriodStartDate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Budget.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Budget.json.cs new file mode 100644 index 000000000000..42d6e34ced5f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Budget.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A budget resource. + public partial class Budget + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal Budget(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new Budget(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/BudgetComparisonExpression.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetComparisonExpression.PowerShell.cs new file mode 100644 index 000000000000..9206dfa2d8bc --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetComparisonExpression.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The comparison expression to be used in the budgets. + [System.ComponentModel.TypeConverter(typeof(BudgetComparisonExpressionTypeConverter))] + public partial class BudgetComparisonExpression + { + + /// + /// 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 BudgetComparisonExpression(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.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)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 BudgetComparisonExpression(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.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)this).Value, __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.Consumption.Models.Api20211001.IBudgetComparisonExpression DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BudgetComparisonExpression(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.Consumption.Models.Api20211001.IBudgetComparisonExpression DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BudgetComparisonExpression(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.Consumption.Models.Api20211001.IBudgetComparisonExpression FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The comparison expression to be used in the budgets. + [System.ComponentModel.TypeConverter(typeof(BudgetComparisonExpressionTypeConverter))] + public partial interface IBudgetComparisonExpression + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetComparisonExpression.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetComparisonExpression.TypeConverter.cs new file mode 100644 index 000000000000..7f19dd965581 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetComparisonExpression.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BudgetComparisonExpressionTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBudgetComparisonExpression ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BudgetComparisonExpression.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BudgetComparisonExpression.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BudgetComparisonExpression.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/consumption/generated/api/Models/Api20211001/BudgetComparisonExpression.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetComparisonExpression.cs new file mode 100644 index 000000000000..7fc9cd07e432 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetComparisonExpression.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The comparison expression to be used in the budgets. + public partial class BudgetComparisonExpression : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal + { + + /// Internal Acessors for Operator + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public BudgetComparisonExpression() + { + + } + } + /// The comparison expression to be used in the budgets. + public partial interface IBudgetComparisonExpression : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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 budgets. + internal partial interface IBudgetComparisonExpressionInternal + + { + /// 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/consumption/generated/api/Models/Api20211001/BudgetComparisonExpression.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetComparisonExpression.json.cs new file mode 100644 index 000000000000..163596174fba --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetComparisonExpression.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The comparison expression to be used in the budgets. + public partial class BudgetComparisonExpression + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal BudgetComparisonExpression(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new BudgetComparisonExpression(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._operator)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._operator.ToString()) : null, "operator" ,container.Add ); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/BudgetFilter.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilter.PowerShell.cs new file mode 100644 index 000000000000..432fa00128d0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilter.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// May be used to filter budgets by resource group, resource, or meter. + [System.ComponentModel.TypeConverter(typeof(BudgetFilterTypeConverter))] + public partial class BudgetFilter + { + + /// + /// 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 BudgetFilter(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.Consumption.Models.Api20211001.IBudgetFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("And")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilterPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)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 BudgetFilter(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.Consumption.Models.Api20211001.IBudgetFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("And")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilterPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)this).TagValue, __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.Consumption.Models.Api20211001.IBudgetFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BudgetFilter(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.Consumption.Models.Api20211001.IBudgetFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BudgetFilter(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.Consumption.Models.Api20211001.IBudgetFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// May be used to filter budgets by resource group, resource, or meter. + [System.ComponentModel.TypeConverter(typeof(BudgetFilterTypeConverter))] + public partial interface IBudgetFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilter.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilter.TypeConverter.cs new file mode 100644 index 000000000000..1fb2c820d62e --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilter.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BudgetFilterTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBudgetFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BudgetFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BudgetFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BudgetFilter.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/consumption/generated/api/Models/Api20211001/BudgetFilter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilter.cs new file mode 100644 index 000000000000..af75d90bdacd --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilter.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// May be used to filter budgets by resource group, resource, or meter. + public partial class BudgetFilter : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[] _and; + + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[] And { get => this._and; set => this._and = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression _dimension; + + /// Has comparison expression for a dimension + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpression()); set => this._dimension = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Name = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Operator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Value = value ?? null /* arrayOf */; } + + /// Internal Acessors for Dimension + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal.Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpression()); set { {_dimension = value;} } } + + /// Internal Acessors for DimensionOperator + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Operator = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpression()); set { {_tag = value;} } } + + /// Internal Acessors for TagOperator + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Operator = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression _tag; + + /// Has comparison expression for a tag + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpression()); set => this._tag = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Name = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Operator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Value = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public BudgetFilter() + { + + } + } + /// May be used to filter budgets by resource group, resource, or meter. + public partial interface IBudgetFilter : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBudgetFilterProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[] And { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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 name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] TagValue { get; set; } + + } + /// May be used to filter budgets by resource group, resource, or meter. + internal partial interface IBudgetFilterInternal + + { + /// The logical "AND" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[] And { get; set; } + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression 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; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression 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/consumption/generated/api/Models/Api20211001/BudgetFilter.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilter.json.cs new file mode 100644 index 000000000000..ff1a8093a2b1 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilter.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// May be used to filter budgets by resource group, resource, or meter. + public partial class BudgetFilter + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal BudgetFilter(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.BudgetComparisonExpression.FromJson(__jsonDimensions) : Dimension;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpression.FromJson(__jsonTags) : Tag;} + {_and = If( json?.PropertyT("and"), out var __jsonAnd) ? If( __jsonAnd as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBudgetFilterProperties) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilterProperties.FromJson(__u) )) ))() : null : And;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new BudgetFilter(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._dimension ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._dimension.ToJson(null,serializationMode) : null, "dimensions" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + if (null != this._and) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._and ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("and",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilterProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilterProperties.PowerShell.cs new file mode 100644 index 000000000000..5686a9167683 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilterProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The Dimensions or Tags to filter a budget by. + [System.ComponentModel.TypeConverter(typeof(BudgetFilterPropertiesTypeConverter))] + public partial class BudgetFilterProperties + { + + /// + /// 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 BudgetFilterProperties(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.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)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 BudgetFilterProperties(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.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal)this).TagValue, __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.Consumption.Models.Api20211001.IBudgetFilterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BudgetFilterProperties(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.Consumption.Models.Api20211001.IBudgetFilterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BudgetFilterProperties(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.Consumption.Models.Api20211001.IBudgetFilterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Dimensions or Tags to filter a budget by. + [System.ComponentModel.TypeConverter(typeof(BudgetFilterPropertiesTypeConverter))] + public partial interface IBudgetFilterProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilterProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilterProperties.TypeConverter.cs new file mode 100644 index 000000000000..ef0774e830ab --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilterProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BudgetFilterPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBudgetFilterProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BudgetFilterProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BudgetFilterProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BudgetFilterProperties.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/consumption/generated/api/Models/Api20211001/BudgetFilterProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilterProperties.cs new file mode 100644 index 000000000000..1cd1bf33a5c3 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilterProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The Dimensions or Tags to filter a budget by. + public partial class BudgetFilterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression _dimension; + + /// Has comparison expression for a dimension + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpression()); set => this._dimension = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Name = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Operator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Value = value ?? null /* arrayOf */; } + + /// Internal Acessors for Dimension + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal.Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpression()); set { {_dimension = value;} } } + + /// Internal Acessors for DimensionOperator + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Dimension).Operator = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpression()); set { {_tag = value;} } } + + /// Internal Acessors for TagOperator + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterPropertiesInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Operator = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression _tag; + + /// Has comparison expression for a tag + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpression()); set => this._tag = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Name = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Operator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpressionInternal)Tag).Value = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public BudgetFilterProperties() + { + + } + } + /// The Dimensions or Tags to filter a budget by. + public partial interface IBudgetFilterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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 name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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 Dimensions or Tags to filter a budget by. + internal partial interface IBudgetFilterPropertiesInternal + + { + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression 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; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression 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/consumption/generated/api/Models/Api20211001/BudgetFilterProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilterProperties.json.cs new file mode 100644 index 000000000000..78a9a9f8ac2c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetFilterProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The Dimensions or Tags to filter a budget by. + public partial class BudgetFilterProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal BudgetFilterProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.BudgetComparisonExpression.FromJson(__jsonDimensions) : Dimension;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpression.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new BudgetFilterProperties(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._dimension ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._dimension.ToJson(null,serializationMode) : null, "dimensions" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/BudgetProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetProperties.PowerShell.cs new file mode 100644 index 000000000000..373f5fa5a534 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the budget. + [System.ComponentModel.TypeConverter(typeof(BudgetPropertiesTypeConverter))] + public partial class BudgetProperties + { + + /// + /// 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 BudgetProperties(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.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilterTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).CurrentSpend = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend) content.GetValueForProperty("CurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).CurrentSpend, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CurrentSpendTypeConverter.ConvertFrom); + } + if (content.Contains("ForecastSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).ForecastSpend = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend) content.GetValueForProperty("ForecastSpend",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).ForecastSpend, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ForecastSpendTypeConverter.ConvertFrom); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Amount = (decimal) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TimeGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimeGrain = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimeGrain, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType.CreateFrom); + } + if (content.Contains("Notification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Notification = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Notification, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetPropertiesNotificationsTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentSpendAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).CurrentSpendAmount = (decimal?) content.GetValueForProperty("CurrentSpendAmount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).CurrentSpendAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CurrentSpendUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).CurrentSpendUnit = (string) content.GetValueForProperty("CurrentSpendUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).CurrentSpendUnit, global::System.Convert.ToString); + } + if (content.Contains("ForecastSpendAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).ForecastSpendAmount = (decimal?) content.GetValueForProperty("ForecastSpendAmount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).ForecastSpendAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ForecastSpendUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).ForecastSpendUnit = (string) content.GetValueForProperty("ForecastSpendUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).ForecastSpendUnit, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimePeriodStartDate = (global::System.DateTime) content.GetValueForProperty("TimePeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimePeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimePeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("TimePeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimePeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilterPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)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 BudgetProperties(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.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilterTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).CurrentSpend = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend) content.GetValueForProperty("CurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).CurrentSpend, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CurrentSpendTypeConverter.ConvertFrom); + } + if (content.Contains("ForecastSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).ForecastSpend = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend) content.GetValueForProperty("ForecastSpend",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).ForecastSpend, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ForecastSpendTypeConverter.ConvertFrom); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Amount = (decimal) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TimeGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimeGrain = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimeGrain, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType.CreateFrom); + } + if (content.Contains("Notification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Notification = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).Notification, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetPropertiesNotificationsTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentSpendAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).CurrentSpendAmount = (decimal?) content.GetValueForProperty("CurrentSpendAmount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).CurrentSpendAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CurrentSpendUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).CurrentSpendUnit = (string) content.GetValueForProperty("CurrentSpendUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).CurrentSpendUnit, global::System.Convert.ToString); + } + if (content.Contains("ForecastSpendAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).ForecastSpendAmount = (decimal?) content.GetValueForProperty("ForecastSpendAmount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).ForecastSpendAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ForecastSpendUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).ForecastSpendUnit = (string) content.GetValueForProperty("ForecastSpendUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).ForecastSpendUnit, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimePeriodStartDate = (global::System.DateTime) content.GetValueForProperty("TimePeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimePeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimePeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("TimePeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TimePeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilterPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal)this).TagValue, __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.Consumption.Models.Api20211001.IBudgetProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BudgetProperties(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.Consumption.Models.Api20211001.IBudgetProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BudgetProperties(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.Consumption.Models.Api20211001.IBudgetProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the budget. + [System.ComponentModel.TypeConverter(typeof(BudgetPropertiesTypeConverter))] + public partial interface IBudgetProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetProperties.TypeConverter.cs new file mode 100644 index 000000000000..6aa3832c25cb --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BudgetPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBudgetProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BudgetProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BudgetProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BudgetProperties.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/consumption/generated/api/Models/Api20211001/BudgetProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetProperties.cs new file mode 100644 index 000000000000..722466f156ec --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the budget. + public partial class BudgetProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal + { + + /// Backing field for property. + private decimal _amount; + + /// The total amount of cost to track with the budget + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal Amount { get => this._amount; set => this._amount = value; } + + /// Backing field for property. + private string _category= @"Cost"; + + /// The category of the budget, whether the budget tracks cost or usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Category { get => this._category; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend _currentSpend; + + /// The current amount of cost which is being tracked for a budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend CurrentSpend { get => (this._currentSpend = this._currentSpend ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CurrentSpend()); } + + /// The total amount of cost which is being tracked by the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CurrentSpendAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)CurrentSpend).Amount; } + + /// The unit of measure for the budget amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CurrentSpendUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)CurrentSpend).Unit; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).DimensionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).DimensionName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).DimensionOperator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).DimensionValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).DimensionValue = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter _filter; + + /// May be used to filter budgets by user-specified dimensions and/or tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilter()); set => this._filter = value; } + + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[] FilterAnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).And; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).And = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend _forecastSpend; + + /// The forecasted cost which is being tracked for a budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend ForecastSpend { get => (this._forecastSpend = this._forecastSpend ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ForecastSpend()); } + + /// + /// The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the + /// budget contains a forecast alert type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ForecastSpendAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)ForecastSpend).Amount; } + + /// The unit of measure for the budget amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ForecastSpendUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)ForecastSpend).Unit; } + + /// Internal Acessors for Category + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.Category { get => this._category; set { {_category = value;} } } + + /// Internal Acessors for CurrentSpend + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.CurrentSpend { get => (this._currentSpend = this._currentSpend ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CurrentSpend()); set { {_currentSpend = value;} } } + + /// Internal Acessors for CurrentSpendAmount + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.CurrentSpendAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)CurrentSpend).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)CurrentSpend).Amount = value; } + + /// Internal Acessors for CurrentSpendUnit + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.CurrentSpendUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)CurrentSpend).Unit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)CurrentSpend).Unit = value; } + + /// Internal Acessors for DimensionOperator + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).DimensionOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).DimensionOperator = value; } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilter()); set { {_filter = value;} } } + + /// Internal Acessors for FilterDimension + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.FilterDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).Dimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).Dimension = value; } + + /// Internal Acessors for FilterTag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.FilterTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).Tag = value; } + + /// Internal Acessors for ForecastSpend + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.ForecastSpend { get => (this._forecastSpend = this._forecastSpend ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ForecastSpend()); set { {_forecastSpend = value;} } } + + /// Internal Acessors for ForecastSpendAmount + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.ForecastSpendAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)ForecastSpend).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)ForecastSpend).Amount = value; } + + /// Internal Acessors for ForecastSpendUnit + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.ForecastSpendUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)ForecastSpend).Unit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)ForecastSpend).Unit = value; } + + /// Internal Acessors for TagOperator + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).TagOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).TagOperator = value; } + + /// Internal Acessors for TimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetTimePeriod()); set { {_timePeriod = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications _notification; + + /// + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications Notification { get => (this._notification = this._notification ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetPropertiesNotifications()); set => this._notification = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).TagName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).TagName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).TagOperator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).TagValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterInternal)Filter).TagValue = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType _timeGrain; + + /// + /// The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, + /// and BillingAnnual are only supported by WD customers + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType TimeGrain { get => this._timeGrain; set => this._timeGrain = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod _timePeriod; + + /// + /// Has start and end date of the budget. The start date must be first of the month and should be less than the end date. + /// Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve months. Past start + /// date should be selected within the timegrain period. There are no restrictions on the end date. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetTimePeriod()); set => this._timePeriod = value; } + + /// + /// The end date for the budget. If not provided, we default this to 10 years from the start date. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal)TimePeriod).EndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal)TimePeriod).EndDate = value ?? default(global::System.DateTime); } + + /// The start date for the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime TimePeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal)TimePeriod).StartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal)TimePeriod).StartDate = value ; } + + /// Creates an new instance. + public BudgetProperties() + { + + } + } + /// The properties of the budget. + public partial interface IBudgetProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The total amount of cost to track with the budget + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The total amount of cost to track with the budget", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal Amount { get; set; } + /// The category of the budget, whether the budget tracks cost or usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"The category of the budget, whether the budget tracks cost or usage.", + SerializedName = @"category", + PossibleTypes = new [] { typeof(string) })] + string Category { get; } + /// The total amount of cost which is being tracked by the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total amount of cost which is being tracked by the budget.", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CurrentSpendAmount { get; } + /// The unit of measure for the budget amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit of measure for the budget amount.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string CurrentSpendUnit { get; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBudgetFilterProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[] FilterAnd { get; set; } + /// + /// The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the + /// budget contains a forecast alert type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the budget contains a forecast alert type.", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ForecastSpendAmount { get; } + /// The unit of measure for the budget amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit of measure for the budget amount.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string ForecastSpendUnit { get; } + /// + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of notifications associated with the budget. Budget can have up to five notifications.", + SerializedName = @"notifications", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications Notification { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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 time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, + /// and BillingAnnual are only supported by WD customers + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers", + SerializedName = @"timeGrain", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType TimeGrain { get; set; } + /// + /// The end date for the budget. If not provided, we default this to 10 years from the start date. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date for the budget. If not provided, we default this to 10 years from the start date.", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodEndDate { get; set; } + /// The start date for the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start date for the budget.", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime TimePeriodStartDate { get; set; } + + } + /// The properties of the budget. + internal partial interface IBudgetPropertiesInternal + + { + /// The total amount of cost to track with the budget + decimal Amount { get; set; } + /// The category of the budget, whether the budget tracks cost or usage. + string Category { get; set; } + /// The current amount of cost which is being tracked for a budget. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend CurrentSpend { get; set; } + /// The total amount of cost which is being tracked by the budget. + decimal? CurrentSpendAmount { get; set; } + /// The unit of measure for the budget amount. + string CurrentSpendUnit { 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; } + /// May be used to filter budgets by user-specified dimensions and/or tags. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilter Filter { get; set; } + /// The logical "AND" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[] FilterAnd { get; set; } + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression FilterDimension { get; set; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetComparisonExpression FilterTag { get; set; } + /// The forecasted cost which is being tracked for a budget. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend ForecastSpend { get; set; } + /// + /// The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the + /// budget contains a forecast alert type. + /// + decimal? ForecastSpendAmount { get; set; } + /// The unit of measure for the budget amount. + string ForecastSpendUnit { get; set; } + /// + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications Notification { 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; } + /// + /// The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, + /// and BillingAnnual are only supported by WD customers + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType TimeGrain { get; set; } + /// + /// Has start and end date of the budget. The start date must be first of the month and should be less than the end date. + /// Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve months. Past start + /// date should be selected within the timegrain period. There are no restrictions on the end date. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod TimePeriod { get; set; } + /// + /// The end date for the budget. If not provided, we default this to 10 years from the start date. + /// + global::System.DateTime? TimePeriodEndDate { get; set; } + /// The start date for the budget. + global::System.DateTime TimePeriodStartDate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetProperties.json.cs new file mode 100644 index 000000000000..dcb8ba3588f6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the budget. + public partial class BudgetProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal BudgetProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.BudgetTimePeriod.FromJson(__jsonTimePeriod) : TimePeriod;} + {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetFilter.FromJson(__jsonFilter) : Filter;} + {_currentSpend = If( json?.PropertyT("currentSpend"), out var __jsonCurrentSpend) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CurrentSpend.FromJson(__jsonCurrentSpend) : CurrentSpend;} + {_forecastSpend = If( json?.PropertyT("forecastSpend"), out var __jsonForecastSpend) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ForecastSpend.FromJson(__jsonForecastSpend) : ForecastSpend;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} + {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (decimal)__jsonAmount : Amount;} + {_timeGrain = If( json?.PropertyT("timeGrain"), out var __jsonTimeGrain) ? (string)__jsonTimeGrain : (string)TimeGrain;} + {_notification = If( json?.PropertyT("notifications"), out var __jsonNotifications) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetPropertiesNotifications.FromJson(__jsonNotifications) : Notification;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new BudgetProperties(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._timePeriod ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._timePeriod.ToJson(null,serializationMode) : null, "timePeriod" ,container.Add ); + AddIf( null != this._filter ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._filter.ToJson(null,serializationMode) : null, "filter" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._currentSpend ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._currentSpend.ToJson(null,serializationMode) : null, "currentSpend" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._forecastSpend ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._forecastSpend.ToJson(null,serializationMode) : null, "forecastSpend" ,container.Add ); + } + AddIf( null != (((object)this._category)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._category.ToString()) : null, "category" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber(this._amount), "amount" ,container.Add ); + AddIf( null != (((object)this._timeGrain)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._timeGrain.ToString()) : null, "timeGrain" ,container.Add ); + AddIf( null != this._notification ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._notification.ToJson(null,serializationMode) : null, "notifications" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.PowerShell.cs new file mode 100644 index 000000000000..c9bb53a18836 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + /// + [System.ComponentModel.TypeConverter(typeof(BudgetPropertiesNotificationsTypeConverter))] + public partial class BudgetPropertiesNotifications + { + + /// + /// 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 BudgetPropertiesNotifications(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 BudgetPropertiesNotifications(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); + } + + /// + /// 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.Consumption.Models.Api20211001.IBudgetPropertiesNotifications DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BudgetPropertiesNotifications(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.Consumption.Models.Api20211001.IBudgetPropertiesNotifications DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BudgetPropertiesNotifications(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.Consumption.Models.Api20211001.IBudgetPropertiesNotifications FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + [System.ComponentModel.TypeConverter(typeof(BudgetPropertiesNotificationsTypeConverter))] + public partial interface IBudgetPropertiesNotifications + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.TypeConverter.cs new file mode 100644 index 000000000000..deccbae30bcc --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BudgetPropertiesNotificationsTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBudgetPropertiesNotifications ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BudgetPropertiesNotifications.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BudgetPropertiesNotifications.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BudgetPropertiesNotifications.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/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.cs new file mode 100644 index 000000000000..2c690b025cc0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + /// + public partial class BudgetPropertiesNotifications : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotificationsInternal + { + + /// Creates an new instance. + public BudgetPropertiesNotifications() + { + + } + } + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + public partial interface IBudgetPropertiesNotifications : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray + { + + } + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + internal partial interface IBudgetPropertiesNotificationsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.dictionary.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.dictionary.cs new file mode 100644 index 000000000000..dd7ea4ec1b75 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + public partial class BudgetPropertiesNotifications : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotification this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotification 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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.INotification value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetPropertiesNotifications source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.json.cs new file mode 100644 index 000000000000..d04dcaae6ab2 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetPropertiesNotifications.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + /// + public partial class BudgetPropertiesNotifications + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + /// + internal BudgetPropertiesNotifications(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Notification.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new BudgetPropertiesNotifications(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetTimePeriod.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetTimePeriod.PowerShell.cs new file mode 100644 index 000000000000..5984f8c4c645 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetTimePeriod.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The start and end date for a budget. + [System.ComponentModel.TypeConverter(typeof(BudgetTimePeriodTypeConverter))] + public partial class BudgetTimePeriod + { + + /// + /// 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 BudgetTimePeriod(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal)this).StartDate = (global::System.DateTime) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal)this).StartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal)this).EndDate = (global::System.DateTime?) content.GetValueForProperty("EndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal)this).EndDate, (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 BudgetTimePeriod(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal)this).StartDate = (global::System.DateTime) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal)this).StartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal)this).EndDate = (global::System.DateTime?) content.GetValueForProperty("EndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal)this).EndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + 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.Consumption.Models.Api20211001.IBudgetTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BudgetTimePeriod(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.Consumption.Models.Api20211001.IBudgetTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BudgetTimePeriod(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.Consumption.Models.Api20211001.IBudgetTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The start and end date for a budget. + [System.ComponentModel.TypeConverter(typeof(BudgetTimePeriodTypeConverter))] + public partial interface IBudgetTimePeriod + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetTimePeriod.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetTimePeriod.TypeConverter.cs new file mode 100644 index 000000000000..9f626d50118f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetTimePeriod.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BudgetTimePeriodTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBudgetTimePeriod ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BudgetTimePeriod.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BudgetTimePeriod.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BudgetTimePeriod.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/consumption/generated/api/Models/Api20211001/BudgetTimePeriod.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetTimePeriod.cs new file mode 100644 index 000000000000..e4e9e3bb38f5 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetTimePeriod.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The start and end date for a budget. + public partial class BudgetTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriodInternal + { + + /// Backing field for property. + private global::System.DateTime? _endDate; + + /// + /// The end date for the budget. If not provided, we default this to 10 years from the start date. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? EndDate { get => this._endDate; set => this._endDate = value; } + + /// Backing field for property. + private global::System.DateTime _startDate; + + /// The start date for the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime StartDate { get => this._startDate; set => this._startDate = value; } + + /// Creates an new instance. + public BudgetTimePeriod() + { + + } + } + /// The start and end date for a budget. + public partial interface IBudgetTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// + /// The end date for the budget. If not provided, we default this to 10 years from the start date. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date for the budget. If not provided, we default this to 10 years from the start date.", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndDate { get; set; } + /// The start date for the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start date for the budget.", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime StartDate { get; set; } + + } + /// The start and end date for a budget. + internal partial interface IBudgetTimePeriodInternal + + { + /// + /// The end date for the budget. If not provided, we default this to 10 years from the start date. + /// + global::System.DateTime? EndDate { get; set; } + /// The start date for the budget. + global::System.DateTime StartDate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetTimePeriod.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetTimePeriod.json.cs new file mode 100644 index 000000000000..bab303ca9fe1 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetTimePeriod.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The start and end date for a budget. + public partial class BudgetTimePeriod + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal BudgetTimePeriod(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_startDate = If( json?.PropertyT("startDate"), out var __jsonStartDate) ? global::System.DateTime.TryParse((string)__jsonStartDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateValue) ? __jsonStartDateValue : StartDate : StartDate;} + {_endDate = If( json?.PropertyT("endDate"), out var __jsonEndDate) ? global::System.DateTime.TryParse((string)__jsonEndDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateValue) ? __jsonEndDateValue : EndDate : EndDate;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new BudgetTimePeriod(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._startDate.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "startDate" ,container.Add ); + AddIf( null != this._endDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._endDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endDate" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetsListResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetsListResult.PowerShell.cs new file mode 100644 index 000000000000..50929b9ac16b --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetsListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// Result of listing budgets. It contains a list of available budgets in the scope provided. + /// + [System.ComponentModel.TypeConverter(typeof(BudgetsListResultTypeConverter))] + public partial class BudgetsListResult + { + + /// + /// 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 BudgetsListResult(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.Consumption.Models.Api20211001.IBudgetsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResultInternal)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 BudgetsListResult(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.Consumption.Models.Api20211001.IBudgetsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.BudgetTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResultInternal)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.Consumption.Models.Api20211001.IBudgetsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BudgetsListResult(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.Consumption.Models.Api20211001.IBudgetsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BudgetsListResult(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.Consumption.Models.Api20211001.IBudgetsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing budgets. It contains a list of available budgets in the scope provided. + [System.ComponentModel.TypeConverter(typeof(BudgetsListResultTypeConverter))] + public partial interface IBudgetsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetsListResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetsListResult.TypeConverter.cs new file mode 100644 index 000000000000..2c73783fdf45 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetsListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BudgetsListResultTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBudgetsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BudgetsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BudgetsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BudgetsListResult.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/consumption/generated/api/Models/Api20211001/BudgetsListResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetsListResult.cs new file mode 100644 index 000000000000..7c59e1f8d415 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetsListResult.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Result of listing budgets. It contains a list of available budgets in the scope provided. + /// + public partial class BudgetsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResultInternal.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget[] _value; + + /// The list of budgets. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget[] Value { get => this._value; } + + /// Creates an new instance. + public BudgetsListResult() + { + + } + } + /// Result of listing budgets. It contains a list of available budgets in the scope provided. + public partial interface IBudgetsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 budgets. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of budgets.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget[] Value { get; } + + } + /// Result of listing budgets. It contains a list of available budgets in the scope provided. + internal partial interface IBudgetsListResultInternal + + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The list of budgets. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/BudgetsListResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetsListResult.json.cs new file mode 100644 index 000000000000..154f32d0d1ba --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/BudgetsListResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Result of listing budgets. It contains a list of available budgets in the scope provided. + /// + public partial class BudgetsListResult + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal BudgetsListResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBudget) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Budget.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.Consumption.Models.Api20211001.IBudgetsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new BudgetsListResult(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ChargeSummary.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ChargeSummary.PowerShell.cs new file mode 100644 index 000000000000..1736af6c4dce --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ChargeSummary.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// A charge summary resource. + [System.ComponentModel.TypeConverter(typeof(ChargeSummaryTypeConverter))] + public partial class ChargeSummary + { + + /// + /// 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 ChargeSummary(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 ChargeSummary(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + 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.Consumption.Models.Api20211001.IChargeSummary DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ChargeSummary(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.Consumption.Models.Api20211001.IChargeSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ChargeSummary(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.Consumption.Models.Api20211001.IChargeSummary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A charge summary resource. + [System.ComponentModel.TypeConverter(typeof(ChargeSummaryTypeConverter))] + public partial interface IChargeSummary + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ChargeSummary.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ChargeSummary.TypeConverter.cs new file mode 100644 index 000000000000..8219e3595d79 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ChargeSummary.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ChargeSummaryTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IChargeSummary ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ChargeSummary.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ChargeSummary.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ChargeSummary.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/consumption/generated/api/Models/Api20211001/ChargeSummary.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ChargeSummary.cs new file mode 100644 index 000000000000..6c8434fa2036 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ChargeSummary.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A charge summary resource. + public partial class ChargeSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(); + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind _kind; + + /// Specifies the kind of charge summary. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind Kind { get => this._kind; set => this._kind = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ChargeSummary() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// A charge summary resource. + public partial interface IChargeSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource + { + /// Specifies the kind of charge summary. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the kind of charge summary.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind Kind { get; set; } + + } + /// A charge summary resource. + internal partial interface IChargeSummaryInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal + { + /// Specifies the kind of charge summary. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind Kind { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ChargeSummary.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ChargeSummary.json.cs new file mode 100644 index 000000000000..647bdd9afe11 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ChargeSummary.json.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A charge summary resource. + public partial class ChargeSummary + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ChargeSummary(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(json); + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary interface is polymorphic, and + /// the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("kind") ) + { + case "legacy": + { + return new LegacyChargeSummary(json); + } + case "modern": + { + return new ModernChargeSummary(json); + } + } + return new ChargeSummary(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ChargesListResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ChargesListResult.PowerShell.cs new file mode 100644 index 000000000000..cf91e7fa784d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ChargesListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Result of listing charge summary. + [System.ComponentModel.TypeConverter(typeof(ChargesListResultTypeConverter))] + public partial class ChargesListResult + { + + /// + /// 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 ChargesListResult(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.Consumption.Models.Api20211001.IChargesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ChargeSummaryTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ChargesListResult(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.Consumption.Models.Api20211001.IChargesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ChargeSummaryTypeConverter.ConvertFrom)); + } + 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.Consumption.Models.Api20211001.IChargesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ChargesListResult(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.Consumption.Models.Api20211001.IChargesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ChargesListResult(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.Consumption.Models.Api20211001.IChargesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing charge summary. + [System.ComponentModel.TypeConverter(typeof(ChargesListResultTypeConverter))] + public partial interface IChargesListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ChargesListResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ChargesListResult.TypeConverter.cs new file mode 100644 index 000000000000..82c8def17f21 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ChargesListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ChargesListResultTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IChargesListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargesListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ChargesListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ChargesListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ChargesListResult.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/consumption/generated/api/Models/Api20211001/ChargesListResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ChargesListResult.cs new file mode 100644 index 000000000000..e073af8a91a6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ChargesListResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing charge summary. + public partial class ChargesListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargesListResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargesListResultInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargesListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary[] _value; + + /// The list of charge summary + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary[] Value { get => this._value; } + + /// Creates an new instance. + public ChargesListResult() + { + + } + } + /// Result of listing charge summary. + public partial interface IChargesListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The list of charge summary + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of charge summary", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary[] Value { get; } + + } + /// Result of listing charge summary. + internal partial interface IChargesListResultInternal + + { + /// The list of charge summary + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ChargesListResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ChargesListResult.json.cs new file mode 100644 index 000000000000..39ed3e883084 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ChargesListResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing charge summary. + public partial class ChargesListResult + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ChargesListResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IChargeSummary) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ChargeSummary.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargesListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargesListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ChargesListResult(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/CreditBalanceSummary.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CreditBalanceSummary.PowerShell.cs new file mode 100644 index 000000000000..9b62f9597614 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CreditBalanceSummary.PowerShell.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Summary of credit balances. + [System.ComponentModel.TypeConverter(typeof(CreditBalanceSummaryTypeConverter))] + public partial class CreditBalanceSummary + { + + /// + /// 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 CreditBalanceSummary(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EstimatedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("EstimatedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).CurrentBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CurrentBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).CurrentBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("EstimatedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("EstimatedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("EstimatedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceCurrency = (string) content.GetValueForProperty("EstimatedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("EstimatedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceValue = (decimal?) content.GetValueForProperty("EstimatedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CurrentBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).CurrentBalanceCurrency = (string) content.GetValueForProperty("CurrentBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).CurrentBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CurrentBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).CurrentBalanceValue = (decimal?) content.GetValueForProperty("CurrentBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).CurrentBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyCurrency = (string) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRateMonth, (__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 CreditBalanceSummary(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EstimatedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("EstimatedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).CurrentBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CurrentBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).CurrentBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("EstimatedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("EstimatedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("EstimatedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceCurrency = (string) content.GetValueForProperty("EstimatedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("EstimatedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceValue = (decimal?) content.GetValueForProperty("EstimatedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CurrentBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).CurrentBalanceCurrency = (string) content.GetValueForProperty("CurrentBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).CurrentBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CurrentBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).CurrentBalanceValue = (decimal?) content.GetValueForProperty("CurrentBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).CurrentBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyCurrency = (string) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.Consumption.Models.Api20211001.ICreditBalanceSummary DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CreditBalanceSummary(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.Consumption.Models.Api20211001.ICreditBalanceSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CreditBalanceSummary(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.Consumption.Models.Api20211001.ICreditBalanceSummary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Summary of credit balances. + [System.ComponentModel.TypeConverter(typeof(CreditBalanceSummaryTypeConverter))] + public partial interface ICreditBalanceSummary + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/CreditBalanceSummary.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CreditBalanceSummary.TypeConverter.cs new file mode 100644 index 000000000000..064eb94eb045 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CreditBalanceSummary.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CreditBalanceSummaryTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ICreditBalanceSummary ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CreditBalanceSummary.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CreditBalanceSummary.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CreditBalanceSummary.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/consumption/generated/api/Models/Api20211001/CreditBalanceSummary.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CreditBalanceSummary.cs new file mode 100644 index 000000000000..9a07845fd27f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CreditBalanceSummary.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Summary of credit balances. + public partial class CreditBalanceSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _currentBalance; + + /// Current balance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CurrentBalance { get => (this._currentBalance = this._currentBalance ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CurrentBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CurrentBalance).Currency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CurrentBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CurrentBalance).Value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _estimatedBalance; + + /// Estimated balance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount EstimatedBalance { get => (this._estimatedBalance = this._estimatedBalance ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string EstimatedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)EstimatedBalance).Currency; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate _estimatedBalanceInBillingCurrency; + + /// Estimated balance in billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate EstimatedBalanceInBillingCurrency { get => (this._estimatedBalanceInBillingCurrency = this._estimatedBalanceInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string EstimatedBalanceInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)EstimatedBalanceInBillingCurrency).Currency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? EstimatedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)EstimatedBalanceInBillingCurrency).ExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? EstimatedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)EstimatedBalanceInBillingCurrency).ExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? EstimatedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)EstimatedBalanceInBillingCurrency).Value; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? EstimatedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)EstimatedBalance).Value; } + + /// Internal Acessors for CurrentBalance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal.CurrentBalance { get => (this._currentBalance = this._currentBalance ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_currentBalance = value;} } } + + /// Internal Acessors for CurrentBalanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal.CurrentBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CurrentBalance).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CurrentBalance).Currency = value; } + + /// Internal Acessors for CurrentBalanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal.CurrentBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CurrentBalance).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CurrentBalance).Value = value; } + + /// Internal Acessors for EstimatedBalance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal.EstimatedBalance { get => (this._estimatedBalance = this._estimatedBalance ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_estimatedBalance = value;} } } + + /// Internal Acessors for EstimatedBalanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal.EstimatedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)EstimatedBalance).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)EstimatedBalance).Currency = value; } + + /// Internal Acessors for EstimatedBalanceInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal.EstimatedBalanceInBillingCurrency { get => (this._estimatedBalanceInBillingCurrency = this._estimatedBalanceInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); set { {_estimatedBalanceInBillingCurrency = value;} } } + + /// Internal Acessors for EstimatedBalanceInBillingCurrencyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal.EstimatedBalanceInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)EstimatedBalanceInBillingCurrency).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)EstimatedBalanceInBillingCurrency).Currency = value; } + + /// Internal Acessors for EstimatedBalanceInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal.EstimatedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)EstimatedBalanceInBillingCurrency).ExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)EstimatedBalanceInBillingCurrency).ExchangeRate = value; } + + /// Internal Acessors for EstimatedBalanceInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal.EstimatedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)EstimatedBalanceInBillingCurrency).ExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)EstimatedBalanceInBillingCurrency).ExchangeRateMonth = value; } + + /// Internal Acessors for EstimatedBalanceInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal.EstimatedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)EstimatedBalanceInBillingCurrency).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)EstimatedBalanceInBillingCurrency).Value = value; } + + /// Internal Acessors for EstimatedBalanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal.EstimatedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)EstimatedBalance).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)EstimatedBalance).Value = value; } + + /// Creates an new instance. + public CreditBalanceSummary() + { + + } + } + /// Summary of credit balances. + public partial interface ICreditBalanceSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string CurrentBalanceCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CurrentBalanceValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string EstimatedBalanceCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string EstimatedBalanceInBillingCurrencyCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EstimatedBalanceInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? EstimatedBalanceInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EstimatedBalanceInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EstimatedBalanceValue { get; } + + } + /// Summary of credit balances. + internal partial interface ICreditBalanceSummaryInternal + + { + /// Current balance. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CurrentBalance { get; set; } + /// Amount currency. + string CurrentBalanceCurrency { get; set; } + /// Amount. + decimal? CurrentBalanceValue { get; set; } + /// Estimated balance. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount EstimatedBalance { get; set; } + /// Amount currency. + string EstimatedBalanceCurrency { get; set; } + /// Estimated balance in billing currency. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate EstimatedBalanceInBillingCurrency { get; set; } + /// Amount currency. + string EstimatedBalanceInBillingCurrencyCurrency { get; set; } + /// The exchange rate. + decimal? EstimatedBalanceInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? EstimatedBalanceInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? EstimatedBalanceInBillingCurrencyValue { get; set; } + /// Amount. + decimal? EstimatedBalanceValue { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/CreditBalanceSummary.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CreditBalanceSummary.json.cs new file mode 100644 index 000000000000..b21e344757ce --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CreditBalanceSummary.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Summary of credit balances. + public partial class CreditBalanceSummary + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal CreditBalanceSummary(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_estimatedBalance = If( json?.PropertyT("estimatedBalance"), out var __jsonEstimatedBalance) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonEstimatedBalance) : EstimatedBalance;} + {_currentBalance = If( json?.PropertyT("currentBalance"), out var __jsonCurrentBalance) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonCurrentBalance) : CurrentBalance;} + {_estimatedBalanceInBillingCurrency = If( json?.PropertyT("estimatedBalanceInBillingCurrency"), out var __jsonEstimatedBalanceInBillingCurrency) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate.FromJson(__jsonEstimatedBalanceInBillingCurrency) : EstimatedBalanceInBillingCurrency;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new CreditBalanceSummary(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._estimatedBalance ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._estimatedBalance.ToJson(null,serializationMode) : null, "estimatedBalance" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._currentBalance ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._currentBalance.ToJson(null,serializationMode) : null, "currentBalance" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._estimatedBalanceInBillingCurrency ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._estimatedBalanceInBillingCurrency.ToJson(null,serializationMode) : null, "estimatedBalanceInBillingCurrency" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummary.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummary.PowerShell.cs new file mode 100644 index 000000000000..9d2a7933190a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummary.PowerShell.cs @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// A credit summary resource. + [System.ComponentModel.TypeConverter(typeof(CreditSummaryTypeConverter))] + public partial class CreditSummary + { + + /// + /// 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 CreditSummary(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.Consumption.Models.Api20211001.ICreditSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditSummaryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Reseller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).Reseller = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller) content.GetValueForProperty("Reseller",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).Reseller, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResellerTypeConverter.ConvertFrom); + } + if (content.Contains("BalanceSummary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummary = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary) content.GetValueForProperty("BalanceSummary",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummary, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditBalanceSummaryTypeConverter.ConvertFrom); + } + if (content.Contains("PendingCreditAdjustment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingCreditAdjustment = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("PendingCreditAdjustment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingCreditAdjustment, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ExpiredCredit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ExpiredCredit = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ExpiredCredit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ExpiredCredit, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("PendingEligibleCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingEligibleCharge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("PendingEligibleCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingEligibleCharge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("CreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).CreditCurrency = (string) content.GetValueForProperty("CreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).CreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("PropertiesETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PropertiesETag = (string) content.GetValueForProperty("PropertiesETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PropertiesETag, global::System.Convert.ToString); + } + if (content.Contains("ResellerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ResellerId = (string) content.GetValueForProperty("ResellerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ResellerId, global::System.Convert.ToString); + } + if (content.Contains("ResellerDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ResellerDescription = (string) content.GetValueForProperty("ResellerDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ResellerDescription, global::System.Convert.ToString); + } + if (content.Contains("BalanceSummaryEstimatedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummaryEstimatedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("BalanceSummaryEstimatedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummaryEstimatedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("BalanceSummaryCurrentBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummaryCurrentBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("BalanceSummaryCurrentBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummaryCurrentBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("BalanceSummaryEstimatedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummaryEstimatedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("BalanceSummaryEstimatedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummaryEstimatedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("PendingCreditAdjustmentCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingCreditAdjustmentCurrency = (string) content.GetValueForProperty("PendingCreditAdjustmentCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingCreditAdjustmentCurrency, global::System.Convert.ToString); + } + if (content.Contains("PendingCreditAdjustmentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingCreditAdjustmentValue = (decimal?) content.GetValueForProperty("PendingCreditAdjustmentValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingCreditAdjustmentValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExpiredCreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ExpiredCreditCurrency = (string) content.GetValueForProperty("ExpiredCreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ExpiredCreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("ExpiredCreditValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ExpiredCreditValue = (decimal?) content.GetValueForProperty("ExpiredCreditValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ExpiredCreditValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PendingEligibleChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingEligibleChargeCurrency = (string) content.GetValueForProperty("PendingEligibleChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingEligibleChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("PendingEligibleChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingEligibleChargeValue = (decimal?) content.GetValueForProperty("PendingEligibleChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingEligibleChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceCurrency = (string) content.GetValueForProperty("EstimatedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("EstimatedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceValue = (decimal?) content.GetValueForProperty("EstimatedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CurrentBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).CurrentBalanceCurrency = (string) content.GetValueForProperty("CurrentBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).CurrentBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CurrentBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).CurrentBalanceValue = (decimal?) content.GetValueForProperty("CurrentBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).CurrentBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrency = (string) content.GetValueForProperty("EstimatedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRateMonth, (__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 CreditSummary(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.Consumption.Models.Api20211001.ICreditSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditSummaryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Reseller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).Reseller = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller) content.GetValueForProperty("Reseller",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).Reseller, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResellerTypeConverter.ConvertFrom); + } + if (content.Contains("BalanceSummary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummary = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary) content.GetValueForProperty("BalanceSummary",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummary, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditBalanceSummaryTypeConverter.ConvertFrom); + } + if (content.Contains("PendingCreditAdjustment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingCreditAdjustment = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("PendingCreditAdjustment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingCreditAdjustment, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ExpiredCredit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ExpiredCredit = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ExpiredCredit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ExpiredCredit, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("PendingEligibleCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingEligibleCharge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("PendingEligibleCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingEligibleCharge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("CreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).CreditCurrency = (string) content.GetValueForProperty("CreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).CreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("PropertiesETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PropertiesETag = (string) content.GetValueForProperty("PropertiesETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PropertiesETag, global::System.Convert.ToString); + } + if (content.Contains("ResellerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ResellerId = (string) content.GetValueForProperty("ResellerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ResellerId, global::System.Convert.ToString); + } + if (content.Contains("ResellerDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ResellerDescription = (string) content.GetValueForProperty("ResellerDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ResellerDescription, global::System.Convert.ToString); + } + if (content.Contains("BalanceSummaryEstimatedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummaryEstimatedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("BalanceSummaryEstimatedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummaryEstimatedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("BalanceSummaryCurrentBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummaryCurrentBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("BalanceSummaryCurrentBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummaryCurrentBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("BalanceSummaryEstimatedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummaryEstimatedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("BalanceSummaryEstimatedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).BalanceSummaryEstimatedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("PendingCreditAdjustmentCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingCreditAdjustmentCurrency = (string) content.GetValueForProperty("PendingCreditAdjustmentCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingCreditAdjustmentCurrency, global::System.Convert.ToString); + } + if (content.Contains("PendingCreditAdjustmentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingCreditAdjustmentValue = (decimal?) content.GetValueForProperty("PendingCreditAdjustmentValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingCreditAdjustmentValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExpiredCreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ExpiredCreditCurrency = (string) content.GetValueForProperty("ExpiredCreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ExpiredCreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("ExpiredCreditValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ExpiredCreditValue = (decimal?) content.GetValueForProperty("ExpiredCreditValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).ExpiredCreditValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PendingEligibleChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingEligibleChargeCurrency = (string) content.GetValueForProperty("PendingEligibleChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingEligibleChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("PendingEligibleChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingEligibleChargeValue = (decimal?) content.GetValueForProperty("PendingEligibleChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).PendingEligibleChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceCurrency = (string) content.GetValueForProperty("EstimatedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("EstimatedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceValue = (decimal?) content.GetValueForProperty("EstimatedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CurrentBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).CurrentBalanceCurrency = (string) content.GetValueForProperty("CurrentBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).CurrentBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CurrentBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).CurrentBalanceValue = (decimal?) content.GetValueForProperty("CurrentBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).CurrentBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrency = (string) content.GetValueForProperty("EstimatedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal)this).EstimatedBalanceInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.Consumption.Models.Api20211001.ICreditSummary DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CreditSummary(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.Consumption.Models.Api20211001.ICreditSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CreditSummary(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.Consumption.Models.Api20211001.ICreditSummary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A credit summary resource. + [System.ComponentModel.TypeConverter(typeof(CreditSummaryTypeConverter))] + public partial interface ICreditSummary + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummary.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummary.TypeConverter.cs new file mode 100644 index 000000000000..027049dd191d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummary.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CreditSummaryTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ICreditSummary ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CreditSummary.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CreditSummary.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CreditSummary.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/consumption/generated/api/Models/Api20211001/CreditSummary.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummary.cs new file mode 100644 index 000000000000..60843fed085d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummary.cs @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A credit summary resource. + public partial class CreditSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ProxyResource(); + + /// The billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).BillingCurrency; } + + /// The credit currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).CreditCurrency; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CurrentBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).CurrentBalanceCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CurrentBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).CurrentBalanceValue; } + + /// + /// 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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string EstimatedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceCurrency; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string EstimatedBalanceInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceInBillingCurrency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? EstimatedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceInBillingCurrencyExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? EstimatedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceInBillingCurrencyExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? EstimatedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceInBillingCurrencyValue; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? EstimatedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceValue; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ExpiredCreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ExpiredCreditCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ExpiredCreditValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ExpiredCreditValue; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + + /// Internal Acessors for BalanceSummary + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.BalanceSummary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).BalanceSummary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).BalanceSummary = value; } + + /// Internal Acessors for BalanceSummaryCurrentBalance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.BalanceSummaryCurrentBalance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).BalanceSummaryCurrentBalance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).BalanceSummaryCurrentBalance = value; } + + /// Internal Acessors for BalanceSummaryEstimatedBalance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.BalanceSummaryEstimatedBalance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).BalanceSummaryEstimatedBalance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).BalanceSummaryEstimatedBalance = value; } + + /// Internal Acessors for BalanceSummaryEstimatedBalanceInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.BalanceSummaryEstimatedBalanceInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).BalanceSummaryEstimatedBalanceInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).BalanceSummaryEstimatedBalanceInBillingCurrency = value; } + + /// Internal Acessors for BillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.BillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).BillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).BillingCurrency = value; } + + /// Internal Acessors for CreditCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.CreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).CreditCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).CreditCurrency = value; } + + /// Internal Acessors for CurrentBalanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.CurrentBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).CurrentBalanceCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).CurrentBalanceCurrency = value; } + + /// Internal Acessors for CurrentBalanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.CurrentBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).CurrentBalanceValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).CurrentBalanceValue = value; } + + /// Internal Acessors for EstimatedBalanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.EstimatedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceCurrency = value; } + + /// Internal Acessors for EstimatedBalanceInBillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.EstimatedBalanceInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceInBillingCurrency = value; } + + /// Internal Acessors for EstimatedBalanceInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.EstimatedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceInBillingCurrencyExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceInBillingCurrencyExchangeRate = value; } + + /// Internal Acessors for EstimatedBalanceInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.EstimatedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceInBillingCurrencyExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceInBillingCurrencyExchangeRateMonth = value; } + + /// Internal Acessors for EstimatedBalanceInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.EstimatedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceInBillingCurrencyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceInBillingCurrencyValue = value; } + + /// Internal Acessors for EstimatedBalanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.EstimatedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).EstimatedBalanceValue = value; } + + /// Internal Acessors for ExpiredCredit + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.ExpiredCredit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ExpiredCredit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ExpiredCredit = value; } + + /// Internal Acessors for ExpiredCreditCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.ExpiredCreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ExpiredCreditCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ExpiredCreditCurrency = value; } + + /// Internal Acessors for ExpiredCreditValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.ExpiredCreditValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ExpiredCreditValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ExpiredCreditValue = value; } + + /// Internal Acessors for PendingCreditAdjustment + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.PendingCreditAdjustment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingCreditAdjustment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingCreditAdjustment = value; } + + /// Internal Acessors for PendingCreditAdjustmentCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.PendingCreditAdjustmentCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingCreditAdjustmentCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingCreditAdjustmentCurrency = value; } + + /// Internal Acessors for PendingCreditAdjustmentValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.PendingCreditAdjustmentValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingCreditAdjustmentValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingCreditAdjustmentValue = value; } + + /// Internal Acessors for PendingEligibleCharge + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.PendingEligibleCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingEligibleCharge; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingEligibleCharge = value; } + + /// Internal Acessors for PendingEligibleChargeCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.PendingEligibleChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingEligibleChargeCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingEligibleChargeCurrency = value; } + + /// Internal Acessors for PendingEligibleChargeValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.PendingEligibleChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingEligibleChargeValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingEligibleChargeValue = value; } + + /// Internal Acessors for PropertiesETag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.PropertiesETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ETag = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditSummaryProperties()); set { {_property = value;} } } + + /// Internal Acessors for Reseller + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.Reseller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).Reseller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).Reseller = value; } + + /// Internal Acessors for ResellerDescription + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.ResellerDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ResellerDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ResellerDescription = value; } + + /// Internal Acessors for ResellerId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryInternal.ResellerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ResellerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ResellerId = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PendingCreditAdjustmentCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingCreditAdjustmentCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? PendingCreditAdjustmentValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingCreditAdjustmentValue; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PendingEligibleChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingEligibleChargeCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? PendingEligibleChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).PendingEligibleChargeValue; } + + /// The eTag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PropertiesETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ETag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryProperties _property; + + /// The properties of the credit summary. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditSummaryProperties()); set => this._property = value; } + + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ResellerDescription; } + + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)Property).ResellerId; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public CreditSummary() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// A credit summary resource. + public partial interface ICreditSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource + { + /// The billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing currency.", + SerializedName = @"billingCurrency", + PossibleTypes = new [] { typeof(string) })] + string BillingCurrency { get; } + /// The credit currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The credit currency.", + SerializedName = @"creditCurrency", + PossibleTypes = new [] { typeof(string) })] + string CreditCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string CurrentBalanceCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CurrentBalanceValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string EstimatedBalanceCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string EstimatedBalanceInBillingCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EstimatedBalanceInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? EstimatedBalanceInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EstimatedBalanceInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EstimatedBalanceValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ExpiredCreditCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ExpiredCreditValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string PendingCreditAdjustmentCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PendingCreditAdjustmentValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string PendingEligibleChargeCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PendingEligibleChargeValue { get; } + /// The eTag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The eTag for the resource.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + string PropertiesETag { get; } + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property description.", + SerializedName = @"resellerDescription", + PossibleTypes = new [] { typeof(string) })] + string ResellerDescription { get; } + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property ID.", + SerializedName = @"resellerId", + PossibleTypes = new [] { typeof(string) })] + string ResellerId { get; } + + } + /// A credit summary resource. + internal partial interface ICreditSummaryInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal + { + /// Summary of balances associated with this credit summary. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary BalanceSummary { get; set; } + /// Current balance. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount BalanceSummaryCurrentBalance { get; set; } + /// Estimated balance. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount BalanceSummaryEstimatedBalance { get; set; } + /// Estimated balance in billing currency. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate BalanceSummaryEstimatedBalanceInBillingCurrency { get; set; } + /// The billing currency. + string BillingCurrency { get; set; } + /// The credit currency. + string CreditCurrency { get; set; } + /// Amount currency. + string CurrentBalanceCurrency { get; set; } + /// Amount. + decimal? CurrentBalanceValue { get; set; } + /// Amount currency. + string EstimatedBalanceCurrency { get; set; } + /// Amount currency. + string EstimatedBalanceInBillingCurrency { get; set; } + /// The exchange rate. + decimal? EstimatedBalanceInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? EstimatedBalanceInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? EstimatedBalanceInBillingCurrencyValue { get; set; } + /// Amount. + decimal? EstimatedBalanceValue { get; set; } + /// Expired credit. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount ExpiredCredit { get; set; } + /// Amount currency. + string ExpiredCreditCurrency { get; set; } + /// Amount. + decimal? ExpiredCreditValue { get; set; } + /// Pending credit adjustments. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount PendingCreditAdjustment { get; set; } + /// Amount currency. + string PendingCreditAdjustmentCurrency { get; set; } + /// Amount. + decimal? PendingCreditAdjustmentValue { get; set; } + /// Pending eligible charges. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount PendingEligibleCharge { get; set; } + /// Amount currency. + string PendingEligibleChargeCurrency { get; set; } + /// Amount. + decimal? PendingEligibleChargeValue { get; set; } + /// The eTag for the resource. + string PropertiesETag { get; set; } + /// The properties of the credit summary. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryProperties Property { get; set; } + /// Credit's reseller. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Reseller { get; set; } + /// The reseller property description. + string ResellerDescription { get; set; } + /// The reseller property ID. + string ResellerId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummary.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummary.json.cs new file mode 100644 index 000000000000..2958702ea358 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummary.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A credit summary resource. + public partial class CreditSummary + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal CreditSummary(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditSummaryProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new CreditSummary(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/CreditSummaryProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummaryProperties.PowerShell.cs new file mode 100644 index 000000000000..f9e0dfa4f09b --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummaryProperties.PowerShell.cs @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the credit summary. + [System.ComponentModel.TypeConverter(typeof(CreditSummaryPropertiesTypeConverter))] + public partial class CreditSummaryProperties + { + + /// + /// 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 CreditSummaryProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BalanceSummary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummary = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary) content.GetValueForProperty("BalanceSummary",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummary, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditBalanceSummaryTypeConverter.ConvertFrom); + } + if (content.Contains("PendingCreditAdjustment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingCreditAdjustment = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("PendingCreditAdjustment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingCreditAdjustment, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ExpiredCredit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ExpiredCredit = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ExpiredCredit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ExpiredCredit, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("PendingEligibleCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingEligibleCharge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("PendingEligibleCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingEligibleCharge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Reseller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).Reseller = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller) content.GetValueForProperty("Reseller",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).Reseller, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResellerTypeConverter.ConvertFrom); + } + if (content.Contains("CreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).CreditCurrency = (string) content.GetValueForProperty("CreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).CreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ResellerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ResellerId = (string) content.GetValueForProperty("ResellerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ResellerId, global::System.Convert.ToString); + } + if (content.Contains("ResellerDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ResellerDescription = (string) content.GetValueForProperty("ResellerDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ResellerDescription, global::System.Convert.ToString); + } + if (content.Contains("BalanceSummaryEstimatedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummaryEstimatedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("BalanceSummaryEstimatedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummaryEstimatedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("BalanceSummaryCurrentBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummaryCurrentBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("BalanceSummaryCurrentBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummaryCurrentBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("BalanceSummaryEstimatedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummaryEstimatedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("BalanceSummaryEstimatedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummaryEstimatedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("PendingCreditAdjustmentCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingCreditAdjustmentCurrency = (string) content.GetValueForProperty("PendingCreditAdjustmentCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingCreditAdjustmentCurrency, global::System.Convert.ToString); + } + if (content.Contains("PendingCreditAdjustmentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingCreditAdjustmentValue = (decimal?) content.GetValueForProperty("PendingCreditAdjustmentValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingCreditAdjustmentValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExpiredCreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ExpiredCreditCurrency = (string) content.GetValueForProperty("ExpiredCreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ExpiredCreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("ExpiredCreditValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ExpiredCreditValue = (decimal?) content.GetValueForProperty("ExpiredCreditValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ExpiredCreditValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PendingEligibleChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingEligibleChargeCurrency = (string) content.GetValueForProperty("PendingEligibleChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingEligibleChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("PendingEligibleChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingEligibleChargeValue = (decimal?) content.GetValueForProperty("PendingEligibleChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingEligibleChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceCurrency = (string) content.GetValueForProperty("EstimatedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("EstimatedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceValue = (decimal?) content.GetValueForProperty("EstimatedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CurrentBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).CurrentBalanceCurrency = (string) content.GetValueForProperty("CurrentBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).CurrentBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CurrentBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).CurrentBalanceValue = (decimal?) content.GetValueForProperty("CurrentBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).CurrentBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrency = (string) content.GetValueForProperty("EstimatedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrencyExchangeRateMonth, (__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 CreditSummaryProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BalanceSummary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummary = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary) content.GetValueForProperty("BalanceSummary",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummary, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditBalanceSummaryTypeConverter.ConvertFrom); + } + if (content.Contains("PendingCreditAdjustment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingCreditAdjustment = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("PendingCreditAdjustment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingCreditAdjustment, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ExpiredCredit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ExpiredCredit = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ExpiredCredit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ExpiredCredit, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("PendingEligibleCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingEligibleCharge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("PendingEligibleCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingEligibleCharge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Reseller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).Reseller = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller) content.GetValueForProperty("Reseller",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).Reseller, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResellerTypeConverter.ConvertFrom); + } + if (content.Contains("CreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).CreditCurrency = (string) content.GetValueForProperty("CreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).CreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ResellerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ResellerId = (string) content.GetValueForProperty("ResellerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ResellerId, global::System.Convert.ToString); + } + if (content.Contains("ResellerDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ResellerDescription = (string) content.GetValueForProperty("ResellerDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ResellerDescription, global::System.Convert.ToString); + } + if (content.Contains("BalanceSummaryEstimatedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummaryEstimatedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("BalanceSummaryEstimatedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummaryEstimatedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("BalanceSummaryCurrentBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummaryCurrentBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("BalanceSummaryCurrentBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummaryCurrentBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("BalanceSummaryEstimatedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummaryEstimatedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("BalanceSummaryEstimatedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).BalanceSummaryEstimatedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("PendingCreditAdjustmentCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingCreditAdjustmentCurrency = (string) content.GetValueForProperty("PendingCreditAdjustmentCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingCreditAdjustmentCurrency, global::System.Convert.ToString); + } + if (content.Contains("PendingCreditAdjustmentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingCreditAdjustmentValue = (decimal?) content.GetValueForProperty("PendingCreditAdjustmentValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingCreditAdjustmentValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExpiredCreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ExpiredCreditCurrency = (string) content.GetValueForProperty("ExpiredCreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ExpiredCreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("ExpiredCreditValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ExpiredCreditValue = (decimal?) content.GetValueForProperty("ExpiredCreditValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).ExpiredCreditValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PendingEligibleChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingEligibleChargeCurrency = (string) content.GetValueForProperty("PendingEligibleChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingEligibleChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("PendingEligibleChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingEligibleChargeValue = (decimal?) content.GetValueForProperty("PendingEligibleChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).PendingEligibleChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceCurrency = (string) content.GetValueForProperty("EstimatedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("EstimatedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceValue = (decimal?) content.GetValueForProperty("EstimatedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CurrentBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).CurrentBalanceCurrency = (string) content.GetValueForProperty("CurrentBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).CurrentBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CurrentBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).CurrentBalanceValue = (decimal?) content.GetValueForProperty("CurrentBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).CurrentBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrency = (string) content.GetValueForProperty("EstimatedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EstimatedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("EstimatedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal)this).EstimatedBalanceInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.Consumption.Models.Api20211001.ICreditSummaryProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CreditSummaryProperties(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.Consumption.Models.Api20211001.ICreditSummaryProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CreditSummaryProperties(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.Consumption.Models.Api20211001.ICreditSummaryProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the credit summary. + [System.ComponentModel.TypeConverter(typeof(CreditSummaryPropertiesTypeConverter))] + public partial interface ICreditSummaryProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummaryProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummaryProperties.TypeConverter.cs new file mode 100644 index 000000000000..56fc4cb998cc --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummaryProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CreditSummaryPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ICreditSummaryProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CreditSummaryProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CreditSummaryProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CreditSummaryProperties.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/consumption/generated/api/Models/Api20211001/CreditSummaryProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummaryProperties.cs new file mode 100644 index 000000000000..dd19b7b38ee5 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummaryProperties.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the credit summary. + public partial class CreditSummaryProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary _balanceSummary; + + /// Summary of balances associated with this credit summary. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary BalanceSummary { get => (this._balanceSummary = this._balanceSummary ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditBalanceSummary()); } + + /// Backing field for property. + private string _billingCurrency; + + /// The billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingCurrency { get => this._billingCurrency; } + + /// Backing field for property. + private string _creditCurrency; + + /// The credit currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CreditCurrency { get => this._creditCurrency; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CurrentBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).CurrentBalanceCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CurrentBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).CurrentBalanceValue; } + + /// Backing field for property. + private string _eTag; + + /// The eTag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string EstimatedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceCurrency; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string EstimatedBalanceInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrencyCurrency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? EstimatedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrencyExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? EstimatedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrencyExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? EstimatedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrencyValue; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? EstimatedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceValue; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _expiredCredit; + + /// Expired credit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount ExpiredCredit { get => (this._expiredCredit = this._expiredCredit ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ExpiredCreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ExpiredCredit).Currency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ExpiredCreditValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ExpiredCredit).Value; } + + /// Internal Acessors for BalanceSummary + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.BalanceSummary { get => (this._balanceSummary = this._balanceSummary ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditBalanceSummary()); set { {_balanceSummary = value;} } } + + /// Internal Acessors for BalanceSummaryCurrentBalance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.BalanceSummaryCurrentBalance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).CurrentBalance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).CurrentBalance = value; } + + /// Internal Acessors for BalanceSummaryEstimatedBalance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.BalanceSummaryEstimatedBalance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalance = value; } + + /// Internal Acessors for BalanceSummaryEstimatedBalanceInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.BalanceSummaryEstimatedBalanceInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrency = value; } + + /// Internal Acessors for BillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.BillingCurrency { get => this._billingCurrency; set { {_billingCurrency = value;} } } + + /// Internal Acessors for CreditCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.CreditCurrency { get => this._creditCurrency; set { {_creditCurrency = value;} } } + + /// Internal Acessors for CurrentBalanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.CurrentBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).CurrentBalanceCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).CurrentBalanceCurrency = value; } + + /// Internal Acessors for CurrentBalanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.CurrentBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).CurrentBalanceValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).CurrentBalanceValue = value; } + + /// Internal Acessors for ETag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.ETag { get => this._eTag; set { {_eTag = value;} } } + + /// Internal Acessors for EstimatedBalanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.EstimatedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceCurrency = value; } + + /// Internal Acessors for EstimatedBalanceInBillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.EstimatedBalanceInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrencyCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrencyCurrency = value; } + + /// Internal Acessors for EstimatedBalanceInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.EstimatedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrencyExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrencyExchangeRate = value; } + + /// Internal Acessors for EstimatedBalanceInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.EstimatedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrencyExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrencyExchangeRateMonth = value; } + + /// Internal Acessors for EstimatedBalanceInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.EstimatedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrencyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceInBillingCurrencyValue = value; } + + /// Internal Acessors for EstimatedBalanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.EstimatedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummaryInternal)BalanceSummary).EstimatedBalanceValue = value; } + + /// Internal Acessors for ExpiredCredit + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.ExpiredCredit { get => (this._expiredCredit = this._expiredCredit ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_expiredCredit = value;} } } + + /// Internal Acessors for ExpiredCreditCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.ExpiredCreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ExpiredCredit).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ExpiredCredit).Currency = value; } + + /// Internal Acessors for ExpiredCreditValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.ExpiredCreditValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ExpiredCredit).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ExpiredCredit).Value = value; } + + /// Internal Acessors for PendingCreditAdjustment + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.PendingCreditAdjustment { get => (this._pendingCreditAdjustment = this._pendingCreditAdjustment ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_pendingCreditAdjustment = value;} } } + + /// Internal Acessors for PendingCreditAdjustmentCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.PendingCreditAdjustmentCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)PendingCreditAdjustment).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)PendingCreditAdjustment).Currency = value; } + + /// Internal Acessors for PendingCreditAdjustmentValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.PendingCreditAdjustmentValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)PendingCreditAdjustment).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)PendingCreditAdjustment).Value = value; } + + /// Internal Acessors for PendingEligibleCharge + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.PendingEligibleCharge { get => (this._pendingEligibleCharge = this._pendingEligibleCharge ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_pendingEligibleCharge = value;} } } + + /// Internal Acessors for PendingEligibleChargeCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.PendingEligibleChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)PendingEligibleCharge).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)PendingEligibleCharge).Currency = value; } + + /// Internal Acessors for PendingEligibleChargeValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.PendingEligibleChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)PendingEligibleCharge).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)PendingEligibleCharge).Value = value; } + + /// Internal Acessors for Reseller + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.Reseller { get => (this._reseller = this._reseller ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Reseller()); set { {_reseller = value;} } } + + /// Internal Acessors for ResellerDescription + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.ResellerDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Description = value; } + + /// Internal Acessors for ResellerId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryPropertiesInternal.ResellerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _pendingCreditAdjustment; + + /// Pending credit adjustments. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount PendingCreditAdjustment { get => (this._pendingCreditAdjustment = this._pendingCreditAdjustment ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PendingCreditAdjustmentCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)PendingCreditAdjustment).Currency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? PendingCreditAdjustmentValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)PendingCreditAdjustment).Value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _pendingEligibleCharge; + + /// Pending eligible charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount PendingEligibleCharge { get => (this._pendingEligibleCharge = this._pendingEligibleCharge ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PendingEligibleChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)PendingEligibleCharge).Currency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? PendingEligibleChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)PendingEligibleCharge).Value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller _reseller; + + /// Credit's reseller. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Reseller { get => (this._reseller = this._reseller ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Reseller()); } + + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Description; } + + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Id; } + + /// Creates an new instance. + public CreditSummaryProperties() + { + + } + } + /// The properties of the credit summary. + public partial interface ICreditSummaryProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing currency.", + SerializedName = @"billingCurrency", + PossibleTypes = new [] { typeof(string) })] + string BillingCurrency { get; } + /// The credit currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The credit currency.", + SerializedName = @"creditCurrency", + PossibleTypes = new [] { typeof(string) })] + string CreditCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string CurrentBalanceCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CurrentBalanceValue { get; } + /// The eTag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The eTag for the resource.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string EstimatedBalanceCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string EstimatedBalanceInBillingCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EstimatedBalanceInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? EstimatedBalanceInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EstimatedBalanceInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EstimatedBalanceValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ExpiredCreditCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ExpiredCreditValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string PendingCreditAdjustmentCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PendingCreditAdjustmentValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string PendingEligibleChargeCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PendingEligibleChargeValue { get; } + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property description.", + SerializedName = @"resellerDescription", + PossibleTypes = new [] { typeof(string) })] + string ResellerDescription { get; } + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property ID.", + SerializedName = @"resellerId", + PossibleTypes = new [] { typeof(string) })] + string ResellerId { get; } + + } + /// The properties of the credit summary. + internal partial interface ICreditSummaryPropertiesInternal + + { + /// Summary of balances associated with this credit summary. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditBalanceSummary BalanceSummary { get; set; } + /// Current balance. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount BalanceSummaryCurrentBalance { get; set; } + /// Estimated balance. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount BalanceSummaryEstimatedBalance { get; set; } + /// Estimated balance in billing currency. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate BalanceSummaryEstimatedBalanceInBillingCurrency { get; set; } + /// The billing currency. + string BillingCurrency { get; set; } + /// The credit currency. + string CreditCurrency { get; set; } + /// Amount currency. + string CurrentBalanceCurrency { get; set; } + /// Amount. + decimal? CurrentBalanceValue { get; set; } + /// The eTag for the resource. + string ETag { get; set; } + /// Amount currency. + string EstimatedBalanceCurrency { get; set; } + /// Amount currency. + string EstimatedBalanceInBillingCurrency { get; set; } + /// The exchange rate. + decimal? EstimatedBalanceInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? EstimatedBalanceInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? EstimatedBalanceInBillingCurrencyValue { get; set; } + /// Amount. + decimal? EstimatedBalanceValue { get; set; } + /// Expired credit. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount ExpiredCredit { get; set; } + /// Amount currency. + string ExpiredCreditCurrency { get; set; } + /// Amount. + decimal? ExpiredCreditValue { get; set; } + /// Pending credit adjustments. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount PendingCreditAdjustment { get; set; } + /// Amount currency. + string PendingCreditAdjustmentCurrency { get; set; } + /// Amount. + decimal? PendingCreditAdjustmentValue { get; set; } + /// Pending eligible charges. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount PendingEligibleCharge { get; set; } + /// Amount currency. + string PendingEligibleChargeCurrency { get; set; } + /// Amount. + decimal? PendingEligibleChargeValue { get; set; } + /// Credit's reseller. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Reseller { get; set; } + /// The reseller property description. + string ResellerDescription { get; set; } + /// The reseller property ID. + string ResellerId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummaryProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummaryProperties.json.cs new file mode 100644 index 000000000000..667a40781726 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CreditSummaryProperties.json.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the credit summary. + public partial class CreditSummaryProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal CreditSummaryProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_balanceSummary = If( json?.PropertyT("balanceSummary"), out var __jsonBalanceSummary) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.CreditBalanceSummary.FromJson(__jsonBalanceSummary) : BalanceSummary;} + {_pendingCreditAdjustment = If( json?.PropertyT("pendingCreditAdjustments"), out var __jsonPendingCreditAdjustments) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonPendingCreditAdjustments) : PendingCreditAdjustment;} + {_expiredCredit = If( json?.PropertyT("expiredCredit"), out var __jsonExpiredCredit) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonExpiredCredit) : ExpiredCredit;} + {_pendingEligibleCharge = If( json?.PropertyT("pendingEligibleCharges"), out var __jsonPendingEligibleCharges) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonPendingEligibleCharges) : PendingEligibleCharge;} + {_reseller = If( json?.PropertyT("reseller"), out var __jsonReseller) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Reseller.FromJson(__jsonReseller) : Reseller;} + {_creditCurrency = If( json?.PropertyT("creditCurrency"), out var __jsonCreditCurrency) ? (string)__jsonCreditCurrency : (string)CreditCurrency;} + {_billingCurrency = If( json?.PropertyT("billingCurrency"), out var __jsonBillingCurrency) ? (string)__jsonBillingCurrency : (string)BillingCurrency;} + {_eTag = If( json?.PropertyT("eTag"), out var __jsonETag) ? (string)__jsonETag : (string)ETag;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummaryProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new CreditSummaryProperties(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._balanceSummary ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._balanceSummary.ToJson(null,serializationMode) : null, "balanceSummary" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._pendingCreditAdjustment ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._pendingCreditAdjustment.ToJson(null,serializationMode) : null, "pendingCreditAdjustments" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._expiredCredit ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._expiredCredit.ToJson(null,serializationMode) : null, "expiredCredit" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._pendingEligibleCharge ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._pendingEligibleCharge.ToJson(null,serializationMode) : null, "pendingEligibleCharges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._reseller ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._reseller.ToJson(null,serializationMode) : null, "reseller" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._creditCurrency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._creditCurrency.ToString()) : null, "creditCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingCurrency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingCurrency.ToString()) : null, "billingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._eTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/CurrentSpend.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CurrentSpend.PowerShell.cs new file mode 100644 index 000000000000..25bee1c6953b --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CurrentSpend.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The current amount of cost which is being tracked for a budget. + [System.ComponentModel.TypeConverter(typeof(CurrentSpendTypeConverter))] + public partial class CurrentSpend + { + + /// + /// 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 CurrentSpend(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)this).Unit, 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 CurrentSpend(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal)this).Unit, 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.Consumption.Models.Api20211001.ICurrentSpend DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CurrentSpend(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.Consumption.Models.Api20211001.ICurrentSpend DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CurrentSpend(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.Consumption.Models.Api20211001.ICurrentSpend FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The current amount of cost which is being tracked for a budget. + [System.ComponentModel.TypeConverter(typeof(CurrentSpendTypeConverter))] + public partial interface ICurrentSpend + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/CurrentSpend.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CurrentSpend.TypeConverter.cs new file mode 100644 index 000000000000..837aeceb0dce --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CurrentSpend.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CurrentSpendTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ICurrentSpend ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CurrentSpend.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CurrentSpend.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CurrentSpend.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/consumption/generated/api/Models/Api20211001/CurrentSpend.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CurrentSpend.cs new file mode 100644 index 000000000000..2b70f4759cc2 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CurrentSpend.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The current amount of cost which is being tracked for a budget. + public partial class CurrentSpend : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal + { + + /// Backing field for property. + private decimal? _amount; + + /// The total amount of cost which is being tracked by the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Amount { get => this._amount; } + + /// Internal Acessors for Amount + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal.Amount { get => this._amount; set { {_amount = value;} } } + + /// Internal Acessors for Unit + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpendInternal.Unit { get => this._unit; set { {_unit = value;} } } + + /// Backing field for property. + private string _unit; + + /// The unit of measure for the budget amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Unit { get => this._unit; } + + /// Creates an new instance. + public CurrentSpend() + { + + } + } + /// The current amount of cost which is being tracked for a budget. + public partial interface ICurrentSpend : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The total amount of cost which is being tracked by the budget. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total amount of cost which is being tracked by the budget.", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Amount { get; } + /// The unit of measure for the budget amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit of measure for the budget amount.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string Unit { get; } + + } + /// The current amount of cost which is being tracked for a budget. + internal partial interface ICurrentSpendInternal + + { + /// The total amount of cost which is being tracked by the budget. + decimal? Amount { get; set; } + /// The unit of measure for the budget amount. + string Unit { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/CurrentSpend.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/CurrentSpend.json.cs new file mode 100644 index 000000000000..b3b8351beac4 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/CurrentSpend.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The current amount of cost which is being tracked for a budget. + public partial class CurrentSpend + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal CurrentSpend(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (decimal?)__jsonAmount : Amount;} + {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICurrentSpend FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new CurrentSpend(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._amount ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._amount) : null, "amount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/DownloadProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/DownloadProperties.PowerShell.cs new file mode 100644 index 000000000000..3ab291f7fe70 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/DownloadProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the price sheet download. + [System.ComponentModel.TypeConverter(typeof(DownloadPropertiesTypeConverter))] + public partial class DownloadProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IDownloadProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DownloadProperties(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.Consumption.Models.Api20211001.IDownloadProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DownloadProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DownloadProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DownloadUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadPropertiesInternal)this).DownloadUrl = (string) content.GetValueForProperty("DownloadUrl",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadPropertiesInternal)this).DownloadUrl, global::System.Convert.ToString); + } + if (content.Contains("ValidTill")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadPropertiesInternal)this).ValidTill = (string) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadPropertiesInternal)this).ValidTill, 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 DownloadProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DownloadUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadPropertiesInternal)this).DownloadUrl = (string) content.GetValueForProperty("DownloadUrl",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadPropertiesInternal)this).DownloadUrl, global::System.Convert.ToString); + } + if (content.Contains("ValidTill")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadPropertiesInternal)this).ValidTill = (string) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadPropertiesInternal)this).ValidTill, 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.Consumption.Models.Api20211001.IDownloadProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the price sheet download. + [System.ComponentModel.TypeConverter(typeof(DownloadPropertiesTypeConverter))] + public partial interface IDownloadProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/DownloadProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/DownloadProperties.TypeConverter.cs new file mode 100644 index 000000000000..98888131baf9 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/DownloadProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DownloadPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IDownloadProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DownloadProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DownloadProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DownloadProperties.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/consumption/generated/api/Models/Api20211001/DownloadProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/DownloadProperties.cs new file mode 100644 index 000000000000..7efabeef6935 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/DownloadProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the price sheet download. + public partial class DownloadProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadPropertiesInternal + { + + /// Backing field for property. + private string _downloadUrl; + + /// The link (url) to download the pricesheet. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string DownloadUrl { get => this._downloadUrl; } + + /// Internal Acessors for DownloadUrl + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadPropertiesInternal.DownloadUrl { get => this._downloadUrl; set { {_downloadUrl = value;} } } + + /// Internal Acessors for ValidTill + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadPropertiesInternal.ValidTill { get => this._validTill; set { {_validTill = value;} } } + + /// Backing field for property. + private string _validTill; + + /// Download link validity. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ValidTill { get => this._validTill; } + + /// Creates an new instance. + public DownloadProperties() + { + + } + } + /// The properties of the price sheet download. + public partial interface IDownloadProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The link (url) to download the pricesheet. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The link (url) to download the pricesheet.", + SerializedName = @"downloadUrl", + PossibleTypes = new [] { typeof(string) })] + string DownloadUrl { get; } + /// Download link validity. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Download link validity.", + SerializedName = @"validTill", + PossibleTypes = new [] { typeof(string) })] + string ValidTill { get; } + + } + /// The properties of the price sheet download. + internal partial interface IDownloadPropertiesInternal + + { + /// The link (url) to download the pricesheet. + string DownloadUrl { get; set; } + /// Download link validity. + string ValidTill { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/DownloadProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/DownloadProperties.json.cs new file mode 100644 index 000000000000..75699136ad93 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/DownloadProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the price sheet download. + public partial class DownloadProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal DownloadProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_downloadUrl = If( json?.PropertyT("downloadUrl"), out var __jsonDownloadUrl) ? (string)__jsonDownloadUrl : (string)DownloadUrl;} + {_validTill = If( json?.PropertyT("validTill"), out var __jsonValidTill) ? (string)__jsonValidTill : (string)ValidTill;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IDownloadProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new DownloadProperties(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._downloadUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._downloadUrl.ToString()) : null, "downloadUrl" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._validTill)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._validTill.ToString()) : null, "validTill" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ErrorDetails.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ErrorDetails.PowerShell.cs new file mode 100644 index 000000000000..f7582b17798f --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/ErrorDetails.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ErrorDetails.TypeConverter.cs new file mode 100644 index 000000000000..4bcc0e64fc91 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IErrorDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ErrorDetails.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ErrorDetails.cs new file mode 100644 index 000000000000..7f893d1f4433 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The details of the error. + public partial class ErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetails, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetailsInternal + { + + /// Backing field for property. + private string _code; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetailsInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/ErrorDetails.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ErrorDetails.json.cs new file mode 100644 index 000000000000..24a0c51d7baf --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorDetails(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IErrorDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ErrorResponse.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..4bf093526832 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/ErrorResponse.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..2eecdad0eee5 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IErrorResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ErrorResponse.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ErrorResponse.cs new file mode 100644 index 000000000000..41bc8d79a060 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponseInternal + { + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetailsInternal)Error).Code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetails _error; + + /// The details of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorDetails()); set => this._error = value; } + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetailsInternal)Error).Message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetailsInternal)Error).Code = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ErrorDetails()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/ErrorResponse.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ErrorResponse.json.cs new file mode 100644 index 000000000000..b43be19a163b --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ErrorDetails.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/EventProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/EventProperties.PowerShell.cs new file mode 100644 index 000000000000..1baaf608e754 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/EventProperties.PowerShell.cs @@ -0,0 +1,592 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The event properties. + [System.ComponentModel.TypeConverter(typeof(EventPropertiesTypeConverter))] + public partial class EventProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IEventProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventProperties(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.Consumption.Models.Api20211001.IEventProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NewCredit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCredit = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("NewCredit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCredit, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Adjustment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Adjustment = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("Adjustment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Adjustment, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("CreditExpired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpired = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CreditExpired",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpired, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Charge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Charge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("Charge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Charge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ClosedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ClosedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("CanceledCredit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CanceledCredit = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CanceledCredit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CanceledCredit, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Reseller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Reseller = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller) content.GetValueForProperty("Reseller",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Reseller, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResellerTypeConverter.ConvertFrom); + } + if (content.Contains("CreditExpiredInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("CreditExpiredInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("NewCreditInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("NewCreditInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("AdjustmentsInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentsInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("AdjustmentsInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentsInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("ChargesInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargesInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("ChargesInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargesInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("ClosedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("ClosedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("TransactionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).TransactionDate = (global::System.DateTime?) content.GetValueForProperty("TransactionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).TransactionDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).EventType = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType?) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).EventType, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType.CreateFrom); + } + if (content.Contains("InvoiceNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).InvoiceNumber = (string) content.GetValueForProperty("InvoiceNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).InvoiceNumber, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).BillingProfileDisplayName = (string) content.GetValueForProperty("BillingProfileDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).BillingProfileDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LotId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).LotId = (string) content.GetValueForProperty("LotId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).LotId, global::System.Convert.ToString); + } + if (content.Contains("LotSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).LotSource = (string) content.GetValueForProperty("LotSource",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).LotSource, global::System.Convert.ToString); + } + if (content.Contains("CreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditCurrency = (string) content.GetValueForProperty("CreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ResellerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ResellerId = (string) content.GetValueForProperty("ResellerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ResellerId, global::System.Convert.ToString); + } + if (content.Contains("ResellerDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ResellerDescription = (string) content.GetValueForProperty("ResellerDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ResellerDescription, global::System.Convert.ToString); + } + if (content.Contains("NewCreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditCurrency = (string) content.GetValueForProperty("NewCreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("NewCreditValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditValue = (decimal?) content.GetValueForProperty("NewCreditValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AdjustmentCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentCurrency = (string) content.GetValueForProperty("AdjustmentCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentCurrency, global::System.Convert.ToString); + } + if (content.Contains("AdjustmentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentValue = (decimal?) content.GetValueForProperty("AdjustmentValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredCurrency = (string) content.GetValueForProperty("CreditExpiredCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredCurrency, global::System.Convert.ToString); + } + if (content.Contains("CreditExpiredValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredValue = (decimal?) content.GetValueForProperty("CreditExpiredValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeCurrency = (string) content.GetValueForProperty("ChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("ChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeValue = (decimal?) content.GetValueForProperty("ChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceCurrency = (string) content.GetValueForProperty("ClosedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceValue = (decimal?) content.GetValueForProperty("ClosedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CanceledCreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CanceledCreditCurrency = (string) content.GetValueForProperty("CanceledCreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CanceledCreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("CanceledCreditValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CanceledCreditValue = (decimal?) content.GetValueForProperty("CanceledCreditValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CanceledCreditValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyCurrency = (string) content.GetValueForProperty("CreditExpiredInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("CreditExpiredInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyValue = (decimal?) content.GetValueForProperty("CreditExpiredInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("CreditExpiredInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("CreditExpiredInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NewCreditInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyCurrency = (string) content.GetValueForProperty("NewCreditInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("NewCreditInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyValue = (decimal?) content.GetValueForProperty("NewCreditInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NewCreditInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("NewCreditInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NewCreditInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("NewCreditInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AdjustmentInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrency = (string) content.GetValueForProperty("AdjustmentInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("AdjustmentInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrencyValue = (decimal?) content.GetValueForProperty("AdjustmentInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AdjustmentInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("AdjustmentInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AdjustmentInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("AdjustmentInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ChargeInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrency = (string) content.GetValueForProperty("ChargeInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ChargeInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrencyValue = (decimal?) content.GetValueForProperty("ChargeInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("ChargeInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("ChargeInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyCurrency = (string) content.GetValueForProperty("ClosedBalanceInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth, (__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 EventProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NewCredit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCredit = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("NewCredit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCredit, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Adjustment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Adjustment = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("Adjustment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Adjustment, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("CreditExpired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpired = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CreditExpired",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpired, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Charge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Charge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("Charge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Charge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ClosedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ClosedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("CanceledCredit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CanceledCredit = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CanceledCredit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CanceledCredit, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Reseller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Reseller = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller) content.GetValueForProperty("Reseller",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Reseller, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResellerTypeConverter.ConvertFrom); + } + if (content.Contains("CreditExpiredInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("CreditExpiredInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("NewCreditInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("NewCreditInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("AdjustmentsInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentsInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("AdjustmentsInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentsInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("ChargesInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargesInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("ChargesInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargesInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("ClosedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("ClosedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("TransactionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).TransactionDate = (global::System.DateTime?) content.GetValueForProperty("TransactionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).TransactionDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).EventType = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType?) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).EventType, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType.CreateFrom); + } + if (content.Contains("InvoiceNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).InvoiceNumber = (string) content.GetValueForProperty("InvoiceNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).InvoiceNumber, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).BillingProfileDisplayName = (string) content.GetValueForProperty("BillingProfileDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).BillingProfileDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LotId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).LotId = (string) content.GetValueForProperty("LotId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).LotId, global::System.Convert.ToString); + } + if (content.Contains("LotSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).LotSource = (string) content.GetValueForProperty("LotSource",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).LotSource, global::System.Convert.ToString); + } + if (content.Contains("CreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditCurrency = (string) content.GetValueForProperty("CreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ResellerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ResellerId = (string) content.GetValueForProperty("ResellerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ResellerId, global::System.Convert.ToString); + } + if (content.Contains("ResellerDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ResellerDescription = (string) content.GetValueForProperty("ResellerDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ResellerDescription, global::System.Convert.ToString); + } + if (content.Contains("NewCreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditCurrency = (string) content.GetValueForProperty("NewCreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("NewCreditValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditValue = (decimal?) content.GetValueForProperty("NewCreditValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AdjustmentCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentCurrency = (string) content.GetValueForProperty("AdjustmentCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentCurrency, global::System.Convert.ToString); + } + if (content.Contains("AdjustmentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentValue = (decimal?) content.GetValueForProperty("AdjustmentValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredCurrency = (string) content.GetValueForProperty("CreditExpiredCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredCurrency, global::System.Convert.ToString); + } + if (content.Contains("CreditExpiredValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredValue = (decimal?) content.GetValueForProperty("CreditExpiredValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeCurrency = (string) content.GetValueForProperty("ChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("ChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeValue = (decimal?) content.GetValueForProperty("ChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceCurrency = (string) content.GetValueForProperty("ClosedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceValue = (decimal?) content.GetValueForProperty("ClosedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CanceledCreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CanceledCreditCurrency = (string) content.GetValueForProperty("CanceledCreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CanceledCreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("CanceledCreditValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CanceledCreditValue = (decimal?) content.GetValueForProperty("CanceledCreditValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CanceledCreditValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyCurrency = (string) content.GetValueForProperty("CreditExpiredInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("CreditExpiredInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyValue = (decimal?) content.GetValueForProperty("CreditExpiredInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("CreditExpiredInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("CreditExpiredInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).CreditExpiredInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NewCreditInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyCurrency = (string) content.GetValueForProperty("NewCreditInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("NewCreditInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyValue = (decimal?) content.GetValueForProperty("NewCreditInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NewCreditInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("NewCreditInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NewCreditInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("NewCreditInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).NewCreditInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AdjustmentInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrency = (string) content.GetValueForProperty("AdjustmentInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("AdjustmentInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrencyValue = (decimal?) content.GetValueForProperty("AdjustmentInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AdjustmentInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("AdjustmentInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AdjustmentInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("AdjustmentInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).AdjustmentInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ChargeInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrency = (string) content.GetValueForProperty("ChargeInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ChargeInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrencyValue = (decimal?) content.GetValueForProperty("ChargeInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("ChargeInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("ChargeInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ChargeInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyCurrency = (string) content.GetValueForProperty("ClosedBalanceInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.Consumption.Models.Api20211001.IEventProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The event properties. + [System.ComponentModel.TypeConverter(typeof(EventPropertiesTypeConverter))] + public partial interface IEventProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/EventProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/EventProperties.TypeConverter.cs new file mode 100644 index 000000000000..e6df1635666f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/EventProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IEventProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventProperties.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/consumption/generated/api/Models/Api20211001/EventProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/EventProperties.cs new file mode 100644 index 000000000000..27641dc8291f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/EventProperties.cs @@ -0,0 +1,1021 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The event properties. + public partial class EventProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _adjustment; + + /// + /// The amount of balance adjustment. The property is not available for ConsumptionCommitment lots. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Adjustment { get => (this._adjustment = this._adjustment ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AdjustmentCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)Adjustment).Currency; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AdjustmentInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)AdjustmentsInBillingCurrency).Currency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AdjustmentInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)AdjustmentsInBillingCurrency).ExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? AdjustmentInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)AdjustmentsInBillingCurrency).ExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AdjustmentInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)AdjustmentsInBillingCurrency).Value; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AdjustmentValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)Adjustment).Value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate _adjustmentsInBillingCurrency; + + /// The amount of balance adjustment in billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate AdjustmentsInBillingCurrency { get => (this._adjustmentsInBillingCurrency = this._adjustmentsInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); } + + /// Backing field for property. + private string _billingCurrency; + + /// The billing currency of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingCurrency { get => this._billingCurrency; } + + /// Backing field for property. + private string _billingProfileDisplayName; + + /// + /// The display name of the billing profile for which the event happened. The property is only available for billing account + /// of type MicrosoftCustomerAgreement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingProfileDisplayName { get => this._billingProfileDisplayName; } + + /// Backing field for property. + private string _billingProfileId; + + /// + /// The ID that uniquely identifies the billing profile for which the event happened. The property is only available for billing + /// account of type MicrosoftCustomerAgreement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingProfileId { get => this._billingProfileId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _canceledCredit; + + /// Amount of canceled credit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CanceledCredit { get => (this._canceledCredit = this._canceledCredit ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CanceledCreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CanceledCredit).Currency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CanceledCreditValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CanceledCredit).Value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _charge; + + /// + /// The amount of charges for events of type SettleCharges and PendingEligibleCharges. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Charge { get => (this._charge = this._charge ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)Charge).Currency; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ChargeInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ChargesInBillingCurrency).Currency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ChargeInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ChargesInBillingCurrency).ExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? ChargeInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ChargesInBillingCurrency).ExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ChargeInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ChargesInBillingCurrency).Value; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)Charge).Value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate _chargesInBillingCurrency; + + /// + /// The amount of charges for events of type SettleCharges and PendingEligibleCharges in billing currency. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate ChargesInBillingCurrency { get => (this._chargesInBillingCurrency = this._chargesInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _closedBalance; + + /// The balance after the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount ClosedBalance { get => (this._closedBalance = this._closedBalance ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ClosedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalance).Currency; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate _closedBalanceInBillingCurrency; + + /// The balance in billing currency after the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate ClosedBalanceInBillingCurrency { get => (this._closedBalanceInBillingCurrency = this._closedBalanceInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ClosedBalanceInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalanceInBillingCurrency).Currency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ClosedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ClosedBalanceInBillingCurrency).ExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? ClosedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ClosedBalanceInBillingCurrency).ExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ClosedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalanceInBillingCurrency).Value; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ClosedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalance).Value; } + + /// Backing field for property. + private string _creditCurrency; + + /// The credit currency of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CreditCurrency { get => this._creditCurrency; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _creditExpired; + + /// + /// The amount of expired credit or commitment for NewCredit or SettleCharges event. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CreditExpired { get => (this._creditExpired = this._creditExpired ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CreditExpiredCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CreditExpired).Currency; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate _creditExpiredInBillingCurrency; + + /// + /// The amount of expired credit or commitment for NewCredit or SettleCharges event in billing currency. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate CreditExpiredInBillingCurrency { get => (this._creditExpiredInBillingCurrency = this._creditExpiredInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CreditExpiredInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CreditExpiredInBillingCurrency).Currency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CreditExpiredInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)CreditExpiredInBillingCurrency).ExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? CreditExpiredInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)CreditExpiredInBillingCurrency).ExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CreditExpiredInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CreditExpiredInBillingCurrency).Value; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CreditExpiredValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CreditExpired).Value; } + + /// Backing field for property. + private string _description; + + /// The description of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Backing field for property. + private string _eTag; + + /// The eTag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType? _eventType; + + /// Identifies the type of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType? EventType { get => this._eventType; set => this._eventType = value; } + + /// Backing field for property. + private string _invoiceNumber; + + /// + /// The number which uniquely identifies the invoice on which the event was billed. This will be empty for unbilled events. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InvoiceNumber { get => this._invoiceNumber; } + + /// Backing field for property. + private string _lotId; + + /// The ID that uniquely identifies the lot for which the event happened. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string LotId { get => this._lotId; } + + /// Backing field for property. + private string _lotSource; + + /// Identifies the source of the lot for which the event happened. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string LotSource { get => this._lotSource; } + + /// Internal Acessors for Adjustment + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.Adjustment { get => (this._adjustment = this._adjustment ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_adjustment = value;} } } + + /// Internal Acessors for AdjustmentCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.AdjustmentCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)Adjustment).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)Adjustment).Currency = value; } + + /// Internal Acessors for AdjustmentInBillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.AdjustmentInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)AdjustmentsInBillingCurrency).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)AdjustmentsInBillingCurrency).Currency = value; } + + /// Internal Acessors for AdjustmentInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.AdjustmentInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)AdjustmentsInBillingCurrency).ExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)AdjustmentsInBillingCurrency).ExchangeRate = value; } + + /// Internal Acessors for AdjustmentInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.AdjustmentInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)AdjustmentsInBillingCurrency).ExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)AdjustmentsInBillingCurrency).ExchangeRateMonth = value; } + + /// Internal Acessors for AdjustmentInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.AdjustmentInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)AdjustmentsInBillingCurrency).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)AdjustmentsInBillingCurrency).Value = value; } + + /// Internal Acessors for AdjustmentValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.AdjustmentValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)Adjustment).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)Adjustment).Value = value; } + + /// Internal Acessors for AdjustmentsInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.AdjustmentsInBillingCurrency { get => (this._adjustmentsInBillingCurrency = this._adjustmentsInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); set { {_adjustmentsInBillingCurrency = value;} } } + + /// Internal Acessors for BillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.BillingCurrency { get => this._billingCurrency; set { {_billingCurrency = value;} } } + + /// Internal Acessors for BillingProfileDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.BillingProfileDisplayName { get => this._billingProfileDisplayName; set { {_billingProfileDisplayName = value;} } } + + /// Internal Acessors for BillingProfileId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.BillingProfileId { get => this._billingProfileId; set { {_billingProfileId = value;} } } + + /// Internal Acessors for CanceledCredit + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.CanceledCredit { get => (this._canceledCredit = this._canceledCredit ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_canceledCredit = value;} } } + + /// Internal Acessors for CanceledCreditCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.CanceledCreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CanceledCredit).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CanceledCredit).Currency = value; } + + /// Internal Acessors for CanceledCreditValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.CanceledCreditValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CanceledCredit).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CanceledCredit).Value = value; } + + /// Internal Acessors for Charge + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.Charge { get => (this._charge = this._charge ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_charge = value;} } } + + /// Internal Acessors for ChargeCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)Charge).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)Charge).Currency = value; } + + /// Internal Acessors for ChargeInBillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ChargeInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ChargesInBillingCurrency).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ChargesInBillingCurrency).Currency = value; } + + /// Internal Acessors for ChargeInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ChargeInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ChargesInBillingCurrency).ExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ChargesInBillingCurrency).ExchangeRate = value; } + + /// Internal Acessors for ChargeInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ChargeInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ChargesInBillingCurrency).ExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ChargesInBillingCurrency).ExchangeRateMonth = value; } + + /// Internal Acessors for ChargeInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ChargeInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ChargesInBillingCurrency).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ChargesInBillingCurrency).Value = value; } + + /// Internal Acessors for ChargeValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)Charge).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)Charge).Value = value; } + + /// Internal Acessors for ChargesInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ChargesInBillingCurrency { get => (this._chargesInBillingCurrency = this._chargesInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); set { {_chargesInBillingCurrency = value;} } } + + /// Internal Acessors for ClosedBalance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ClosedBalance { get => (this._closedBalance = this._closedBalance ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_closedBalance = value;} } } + + /// Internal Acessors for ClosedBalanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ClosedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalance).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalance).Currency = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ClosedBalanceInBillingCurrency { get => (this._closedBalanceInBillingCurrency = this._closedBalanceInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); set { {_closedBalanceInBillingCurrency = value;} } } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ClosedBalanceInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalanceInBillingCurrency).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalanceInBillingCurrency).Currency = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ClosedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ClosedBalanceInBillingCurrency).ExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ClosedBalanceInBillingCurrency).ExchangeRate = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ClosedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ClosedBalanceInBillingCurrency).ExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ClosedBalanceInBillingCurrency).ExchangeRateMonth = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ClosedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalanceInBillingCurrency).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalanceInBillingCurrency).Value = value; } + + /// Internal Acessors for ClosedBalanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ClosedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalance).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalance).Value = value; } + + /// Internal Acessors for CreditCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.CreditCurrency { get => this._creditCurrency; set { {_creditCurrency = value;} } } + + /// Internal Acessors for CreditExpired + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.CreditExpired { get => (this._creditExpired = this._creditExpired ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_creditExpired = value;} } } + + /// Internal Acessors for CreditExpiredCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.CreditExpiredCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CreditExpired).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CreditExpired).Currency = value; } + + /// Internal Acessors for CreditExpiredInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.CreditExpiredInBillingCurrency { get => (this._creditExpiredInBillingCurrency = this._creditExpiredInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); set { {_creditExpiredInBillingCurrency = value;} } } + + /// Internal Acessors for CreditExpiredInBillingCurrencyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.CreditExpiredInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CreditExpiredInBillingCurrency).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CreditExpiredInBillingCurrency).Currency = value; } + + /// Internal Acessors for CreditExpiredInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.CreditExpiredInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)CreditExpiredInBillingCurrency).ExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)CreditExpiredInBillingCurrency).ExchangeRate = value; } + + /// Internal Acessors for CreditExpiredInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.CreditExpiredInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)CreditExpiredInBillingCurrency).ExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)CreditExpiredInBillingCurrency).ExchangeRateMonth = value; } + + /// Internal Acessors for CreditExpiredInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.CreditExpiredInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CreditExpiredInBillingCurrency).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CreditExpiredInBillingCurrency).Value = value; } + + /// Internal Acessors for CreditExpiredValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.CreditExpiredValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CreditExpired).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CreditExpired).Value = value; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for ETag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ETag { get => this._eTag; set { {_eTag = value;} } } + + /// Internal Acessors for InvoiceNumber + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.InvoiceNumber { get => this._invoiceNumber; set { {_invoiceNumber = value;} } } + + /// Internal Acessors for LotId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.LotId { get => this._lotId; set { {_lotId = value;} } } + + /// Internal Acessors for LotSource + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.LotSource { get => this._lotSource; set { {_lotSource = value;} } } + + /// Internal Acessors for NewCredit + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.NewCredit { get => (this._newCredit = this._newCredit ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_newCredit = value;} } } + + /// Internal Acessors for NewCreditCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.NewCreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NewCredit).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NewCredit).Currency = value; } + + /// Internal Acessors for NewCreditInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.NewCreditInBillingCurrency { get => (this._newCreditInBillingCurrency = this._newCreditInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); set { {_newCreditInBillingCurrency = value;} } } + + /// Internal Acessors for NewCreditInBillingCurrencyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.NewCreditInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NewCreditInBillingCurrency).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NewCreditInBillingCurrency).Currency = value; } + + /// Internal Acessors for NewCreditInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.NewCreditInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)NewCreditInBillingCurrency).ExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)NewCreditInBillingCurrency).ExchangeRate = value; } + + /// Internal Acessors for NewCreditInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.NewCreditInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)NewCreditInBillingCurrency).ExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)NewCreditInBillingCurrency).ExchangeRateMonth = value; } + + /// Internal Acessors for NewCreditInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.NewCreditInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NewCreditInBillingCurrency).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NewCreditInBillingCurrency).Value = value; } + + /// Internal Acessors for NewCreditValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.NewCreditValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NewCredit).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NewCredit).Value = value; } + + /// Internal Acessors for Reseller + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.Reseller { get => (this._reseller = this._reseller ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Reseller()); set { {_reseller = value;} } } + + /// Internal Acessors for ResellerDescription + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ResellerDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Description = value; } + + /// Internal Acessors for ResellerId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.ResellerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Id = value; } + + /// Internal Acessors for TransactionDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal.TransactionDate { get => this._transactionDate; set { {_transactionDate = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _newCredit; + + /// The amount of new credit or commitment for NewCredit or SettleCharges event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount NewCredit { get => (this._newCredit = this._newCredit ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string NewCreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NewCredit).Currency; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate _newCreditInBillingCurrency; + + /// + /// The amount of new credit or commitment for NewCredit or SettleCharges event in billing currency. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate NewCreditInBillingCurrency { get => (this._newCreditInBillingCurrency = this._newCreditInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string NewCreditInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NewCreditInBillingCurrency).Currency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? NewCreditInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)NewCreditInBillingCurrency).ExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? NewCreditInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)NewCreditInBillingCurrency).ExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? NewCreditInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NewCreditInBillingCurrency).Value; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? NewCreditValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NewCredit).Value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller _reseller; + + /// The reseller of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Reseller { get => (this._reseller = this._reseller ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Reseller()); } + + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Description; } + + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Id; } + + /// Backing field for property. + private global::System.DateTime? _transactionDate; + + /// The date of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? TransactionDate { get => this._transactionDate; } + + /// Creates an new instance. + public EventProperties() + { + + } + } + /// The event properties. + public partial interface IEventProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string AdjustmentCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string AdjustmentInBillingCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AdjustmentInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? AdjustmentInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AdjustmentInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AdjustmentValue { get; } + /// The billing currency of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing currency of the event.", + SerializedName = @"billingCurrency", + PossibleTypes = new [] { typeof(string) })] + string BillingCurrency { get; } + /// + /// The display name of the billing profile for which the event happened. The property is only available for billing account + /// of type MicrosoftCustomerAgreement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The display name of the billing profile for which the event happened. The property is only available for billing account of type MicrosoftCustomerAgreement.", + SerializedName = @"billingProfileDisplayName", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileDisplayName { get; } + /// + /// The ID that uniquely identifies the billing profile for which the event happened. The property is only available for billing + /// account of type MicrosoftCustomerAgreement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ID that uniquely identifies the billing profile for which the event happened. The property is only available for billing account of type MicrosoftCustomerAgreement. ", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileId { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string CanceledCreditCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CanceledCreditValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ChargeCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ChargeInBillingCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargeInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? ChargeInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargeInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargeValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ClosedBalanceCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ClosedBalanceInBillingCurrencyCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ClosedBalanceInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? ClosedBalanceInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ClosedBalanceInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ClosedBalanceValue { get; } + /// The credit currency of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The credit currency of the event.", + SerializedName = @"creditCurrency", + PossibleTypes = new [] { typeof(string) })] + string CreditCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string CreditExpiredCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string CreditExpiredInBillingCurrencyCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CreditExpiredInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? CreditExpiredInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CreditExpiredInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CreditExpiredValue { get; } + /// The description of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The description of the event.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// The eTag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The eTag for the resource.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; } + /// Identifies the type of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifies the type of the event.", + SerializedName = @"eventType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType? EventType { get; set; } + /// + /// The number which uniquely identifies the invoice on which the event was billed. This will be empty for unbilled events. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The number which uniquely identifies the invoice on which the event was billed. This will be empty for unbilled events.", + SerializedName = @"invoiceNumber", + PossibleTypes = new [] { typeof(string) })] + string InvoiceNumber { get; } + /// The ID that uniquely identifies the lot for which the event happened. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ID that uniquely identifies the lot for which the event happened.", + SerializedName = @"lotId", + PossibleTypes = new [] { typeof(string) })] + string LotId { get; } + /// Identifies the source of the lot for which the event happened. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifies the source of the lot for which the event happened. ", + SerializedName = @"lotSource", + PossibleTypes = new [] { typeof(string) })] + string LotSource { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string NewCreditCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string NewCreditInBillingCurrencyCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? NewCreditInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? NewCreditInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? NewCreditInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? NewCreditValue { get; } + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property description.", + SerializedName = @"resellerDescription", + PossibleTypes = new [] { typeof(string) })] + string ResellerDescription { get; } + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property ID.", + SerializedName = @"resellerId", + PossibleTypes = new [] { typeof(string) })] + string ResellerId { get; } + /// The date of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date of the event.", + SerializedName = @"transactionDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TransactionDate { get; } + + } + /// The event properties. + internal partial interface IEventPropertiesInternal + + { + /// + /// The amount of balance adjustment. The property is not available for ConsumptionCommitment lots. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Adjustment { get; set; } + /// Amount currency. + string AdjustmentCurrency { get; set; } + /// Amount currency. + string AdjustmentInBillingCurrency { get; set; } + /// The exchange rate. + decimal? AdjustmentInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? AdjustmentInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? AdjustmentInBillingCurrencyValue { get; set; } + /// Amount. + decimal? AdjustmentValue { get; set; } + /// The amount of balance adjustment in billing currency. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate AdjustmentsInBillingCurrency { get; set; } + /// The billing currency of the event. + string BillingCurrency { get; set; } + /// + /// The display name of the billing profile for which the event happened. The property is only available for billing account + /// of type MicrosoftCustomerAgreement. + /// + string BillingProfileDisplayName { get; set; } + /// + /// The ID that uniquely identifies the billing profile for which the event happened. The property is only available for billing + /// account of type MicrosoftCustomerAgreement. + /// + string BillingProfileId { get; set; } + /// Amount of canceled credit. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CanceledCredit { get; set; } + /// Amount currency. + string CanceledCreditCurrency { get; set; } + /// Amount. + decimal? CanceledCreditValue { get; set; } + /// + /// The amount of charges for events of type SettleCharges and PendingEligibleCharges. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Charge { get; set; } + /// Amount currency. + string ChargeCurrency { get; set; } + /// Amount currency. + string ChargeInBillingCurrency { get; set; } + /// The exchange rate. + decimal? ChargeInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? ChargeInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? ChargeInBillingCurrencyValue { get; set; } + /// Amount. + decimal? ChargeValue { get; set; } + /// + /// The amount of charges for events of type SettleCharges and PendingEligibleCharges in billing currency. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate ChargesInBillingCurrency { get; set; } + /// The balance after the event. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount ClosedBalance { get; set; } + /// Amount currency. + string ClosedBalanceCurrency { get; set; } + /// The balance in billing currency after the event. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate ClosedBalanceInBillingCurrency { get; set; } + /// Amount currency. + string ClosedBalanceInBillingCurrencyCurrency { get; set; } + /// The exchange rate. + decimal? ClosedBalanceInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? ClosedBalanceInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? ClosedBalanceInBillingCurrencyValue { get; set; } + /// Amount. + decimal? ClosedBalanceValue { get; set; } + /// The credit currency of the event. + string CreditCurrency { get; set; } + /// + /// The amount of expired credit or commitment for NewCredit or SettleCharges event. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CreditExpired { get; set; } + /// Amount currency. + string CreditExpiredCurrency { get; set; } + /// + /// The amount of expired credit or commitment for NewCredit or SettleCharges event in billing currency. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate CreditExpiredInBillingCurrency { get; set; } + /// Amount currency. + string CreditExpiredInBillingCurrencyCurrency { get; set; } + /// The exchange rate. + decimal? CreditExpiredInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? CreditExpiredInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? CreditExpiredInBillingCurrencyValue { get; set; } + /// Amount. + decimal? CreditExpiredValue { get; set; } + /// The description of the event. + string Description { get; set; } + /// The eTag for the resource. + string ETag { get; set; } + /// Identifies the type of the event. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType? EventType { get; set; } + /// + /// The number which uniquely identifies the invoice on which the event was billed. This will be empty for unbilled events. + /// + string InvoiceNumber { get; set; } + /// The ID that uniquely identifies the lot for which the event happened. + string LotId { get; set; } + /// Identifies the source of the lot for which the event happened. + string LotSource { get; set; } + /// The amount of new credit or commitment for NewCredit or SettleCharges event. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount NewCredit { get; set; } + /// Amount currency. + string NewCreditCurrency { get; set; } + /// + /// The amount of new credit or commitment for NewCredit or SettleCharges event in billing currency. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate NewCreditInBillingCurrency { get; set; } + /// Amount currency. + string NewCreditInBillingCurrencyCurrency { get; set; } + /// The exchange rate. + decimal? NewCreditInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? NewCreditInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? NewCreditInBillingCurrencyValue { get; set; } + /// Amount. + decimal? NewCreditValue { get; set; } + /// The reseller of the event. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Reseller { get; set; } + /// The reseller property description. + string ResellerDescription { get; set; } + /// The reseller property ID. + string ResellerId { get; set; } + /// The date of the event. + global::System.DateTime? TransactionDate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/EventProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/EventProperties.json.cs new file mode 100644 index 000000000000..65df6d950ef7 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/EventProperties.json.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The event properties. + public partial class EventProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal EventProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_newCredit = If( json?.PropertyT("newCredit"), out var __jsonNewCredit) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonNewCredit) : NewCredit;} + {_adjustment = If( json?.PropertyT("adjustments"), out var __jsonAdjustments) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonAdjustments) : Adjustment;} + {_creditExpired = If( json?.PropertyT("creditExpired"), out var __jsonCreditExpired) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonCreditExpired) : CreditExpired;} + {_charge = If( json?.PropertyT("charges"), out var __jsonCharges) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonCharges) : Charge;} + {_closedBalance = If( json?.PropertyT("closedBalance"), out var __jsonClosedBalance) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonClosedBalance) : ClosedBalance;} + {_canceledCredit = If( json?.PropertyT("canceledCredit"), out var __jsonCanceledCredit) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonCanceledCredit) : CanceledCredit;} + {_reseller = If( json?.PropertyT("reseller"), out var __jsonReseller) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Reseller.FromJson(__jsonReseller) : Reseller;} + {_creditExpiredInBillingCurrency = If( json?.PropertyT("creditExpiredInBillingCurrency"), out var __jsonCreditExpiredInBillingCurrency) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate.FromJson(__jsonCreditExpiredInBillingCurrency) : CreditExpiredInBillingCurrency;} + {_newCreditInBillingCurrency = If( json?.PropertyT("newCreditInBillingCurrency"), out var __jsonNewCreditInBillingCurrency) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate.FromJson(__jsonNewCreditInBillingCurrency) : NewCreditInBillingCurrency;} + {_adjustmentsInBillingCurrency = If( json?.PropertyT("adjustmentsInBillingCurrency"), out var __jsonAdjustmentsInBillingCurrency) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate.FromJson(__jsonAdjustmentsInBillingCurrency) : AdjustmentsInBillingCurrency;} + {_chargesInBillingCurrency = If( json?.PropertyT("chargesInBillingCurrency"), out var __jsonChargesInBillingCurrency) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate.FromJson(__jsonChargesInBillingCurrency) : ChargesInBillingCurrency;} + {_closedBalanceInBillingCurrency = If( json?.PropertyT("closedBalanceInBillingCurrency"), out var __jsonClosedBalanceInBillingCurrency) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate.FromJson(__jsonClosedBalanceInBillingCurrency) : ClosedBalanceInBillingCurrency;} + {_transactionDate = If( json?.PropertyT("transactionDate"), out var __jsonTransactionDate) ? global::System.DateTime.TryParse((string)__jsonTransactionDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTransactionDateValue) ? __jsonTransactionDateValue : TransactionDate : TransactionDate;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_eventType = If( json?.PropertyT("eventType"), out var __jsonEventType) ? (string)__jsonEventType : (string)EventType;} + {_invoiceNumber = If( json?.PropertyT("invoiceNumber"), out var __jsonInvoiceNumber) ? (string)__jsonInvoiceNumber : (string)InvoiceNumber;} + {_billingProfileId = If( json?.PropertyT("billingProfileId"), out var __jsonBillingProfileId) ? (string)__jsonBillingProfileId : (string)BillingProfileId;} + {_billingProfileDisplayName = If( json?.PropertyT("billingProfileDisplayName"), out var __jsonBillingProfileDisplayName) ? (string)__jsonBillingProfileDisplayName : (string)BillingProfileDisplayName;} + {_lotId = If( json?.PropertyT("lotId"), out var __jsonLotId) ? (string)__jsonLotId : (string)LotId;} + {_lotSource = If( json?.PropertyT("lotSource"), out var __jsonLotSource) ? (string)__jsonLotSource : (string)LotSource;} + {_creditCurrency = If( json?.PropertyT("creditCurrency"), out var __jsonCreditCurrency) ? (string)__jsonCreditCurrency : (string)CreditCurrency;} + {_billingCurrency = If( json?.PropertyT("billingCurrency"), out var __jsonBillingCurrency) ? (string)__jsonBillingCurrency : (string)BillingCurrency;} + {_eTag = If( json?.PropertyT("eTag"), out var __jsonETag) ? (string)__jsonETag : (string)ETag;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new EventProperties(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._newCredit ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._newCredit.ToJson(null,serializationMode) : null, "newCredit" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._adjustment ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._adjustment.ToJson(null,serializationMode) : null, "adjustments" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._creditExpired ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._creditExpired.ToJson(null,serializationMode) : null, "creditExpired" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._charge ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._charge.ToJson(null,serializationMode) : null, "charges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._closedBalance ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._closedBalance.ToJson(null,serializationMode) : null, "closedBalance" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._canceledCredit ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._canceledCredit.ToJson(null,serializationMode) : null, "canceledCredit" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._reseller ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._reseller.ToJson(null,serializationMode) : null, "reseller" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._creditExpiredInBillingCurrency ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._creditExpiredInBillingCurrency.ToJson(null,serializationMode) : null, "creditExpiredInBillingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._newCreditInBillingCurrency ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._newCreditInBillingCurrency.ToJson(null,serializationMode) : null, "newCreditInBillingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._adjustmentsInBillingCurrency ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._adjustmentsInBillingCurrency.ToJson(null,serializationMode) : null, "adjustmentsInBillingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._chargesInBillingCurrency ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._chargesInBillingCurrency.ToJson(null,serializationMode) : null, "chargesInBillingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._closedBalanceInBillingCurrency ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._closedBalanceInBillingCurrency.ToJson(null,serializationMode) : null, "closedBalanceInBillingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._transactionDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._transactionDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "transactionDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + } + AddIf( null != (((object)this._eventType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._eventType.ToString()) : null, "eventType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._invoiceNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._invoiceNumber.ToString()) : null, "invoiceNumber" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingProfileId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingProfileId.ToString()) : null, "billingProfileId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingProfileDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingProfileDisplayName.ToString()) : null, "billingProfileDisplayName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lotId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._lotId.ToString()) : null, "lotId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lotSource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._lotSource.ToString()) : null, "lotSource" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._creditCurrency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._creditCurrency.ToString()) : null, "creditCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingCurrency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingCurrency.ToString()) : null, "billingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._eTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/EventSummary.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/EventSummary.PowerShell.cs new file mode 100644 index 000000000000..71a48a18d5eb --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/EventSummary.PowerShell.cs @@ -0,0 +1,632 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// An event summary resource. + [System.ComponentModel.TypeConverter(typeof(EventSummaryTypeConverter))] + public partial class EventSummary + { + + /// + /// 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.Consumption.Models.Api20211001.IEventSummary DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventSummary(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.Consumption.Models.Api20211001.IEventSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventSummary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventSummary(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.Consumption.Models.Api20211001.IEventSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.EventPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Reseller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Reseller = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller) content.GetValueForProperty("Reseller",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Reseller, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResellerTypeConverter.ConvertFrom); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).EventType = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType?) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).EventType, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType.CreateFrom); + } + if (content.Contains("NewCredit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCredit = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("NewCredit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCredit, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Adjustment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Adjustment = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("Adjustment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Adjustment, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("CreditExpired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpired = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CreditExpired",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpired, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Charge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Charge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("Charge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Charge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ClosedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ClosedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("CanceledCredit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CanceledCredit = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CanceledCredit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CanceledCredit, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesCreditExpiredInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesCreditExpiredInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("PropertiesCreditExpiredInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesCreditExpiredInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesNewCreditInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesNewCreditInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("PropertiesNewCreditInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesNewCreditInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("AdjustmentsInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentsInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("AdjustmentsInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentsInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("ChargesInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargesInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("ChargesInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargesInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesClosedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesClosedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("PropertiesClosedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesClosedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("TransactionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).TransactionDate = (global::System.DateTime?) content.GetValueForProperty("TransactionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).TransactionDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("InvoiceNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).InvoiceNumber = (string) content.GetValueForProperty("InvoiceNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).InvoiceNumber, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).BillingProfileDisplayName = (string) content.GetValueForProperty("BillingProfileDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).BillingProfileDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LotId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).LotId = (string) content.GetValueForProperty("LotId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).LotId, global::System.Convert.ToString); + } + if (content.Contains("LotSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).LotSource = (string) content.GetValueForProperty("LotSource",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).LotSource, global::System.Convert.ToString); + } + if (content.Contains("CreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditCurrency = (string) content.GetValueForProperty("CreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("PropertiesETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesETag = (string) content.GetValueForProperty("PropertiesETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesETag, global::System.Convert.ToString); + } + if (content.Contains("ResellerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ResellerId = (string) content.GetValueForProperty("ResellerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ResellerId, global::System.Convert.ToString); + } + if (content.Contains("ResellerDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ResellerDescription = (string) content.GetValueForProperty("ResellerDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ResellerDescription, global::System.Convert.ToString); + } + if (content.Contains("NewCreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditCurrency = (string) content.GetValueForProperty("NewCreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("NewCreditValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditValue = (decimal?) content.GetValueForProperty("NewCreditValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AdjustmentCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentCurrency = (string) content.GetValueForProperty("AdjustmentCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentCurrency, global::System.Convert.ToString); + } + if (content.Contains("AdjustmentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentValue = (decimal?) content.GetValueForProperty("AdjustmentValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredCurrency = (string) content.GetValueForProperty("CreditExpiredCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredCurrency, global::System.Convert.ToString); + } + if (content.Contains("CreditExpiredValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredValue = (decimal?) content.GetValueForProperty("CreditExpiredValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeCurrency = (string) content.GetValueForProperty("ChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("ChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeValue = (decimal?) content.GetValueForProperty("ChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceCurrency = (string) content.GetValueForProperty("ClosedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceValue = (decimal?) content.GetValueForProperty("ClosedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CanceledCreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CanceledCreditCurrency = (string) content.GetValueForProperty("CanceledCreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CanceledCreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("CanceledCreditValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CanceledCreditValue = (decimal?) content.GetValueForProperty("CanceledCreditValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CanceledCreditValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PropertiesCreditExpiredInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesCreditExpiredInBillingCurrencyCurrency = (string) content.GetValueForProperty("PropertiesCreditExpiredInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesCreditExpiredInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("CreditExpiredInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredInBillingCurrencyValue = (decimal?) content.GetValueForProperty("CreditExpiredInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("CreditExpiredInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("CreditExpiredInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertiesNewCreditInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesNewCreditInBillingCurrencyCurrency = (string) content.GetValueForProperty("PropertiesNewCreditInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesNewCreditInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("NewCreditInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditInBillingCurrencyValue = (decimal?) content.GetValueForProperty("NewCreditInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NewCreditInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("NewCreditInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NewCreditInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("NewCreditInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AdjustmentInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrency = (string) content.GetValueForProperty("AdjustmentInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("AdjustmentInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrencyValue = (decimal?) content.GetValueForProperty("AdjustmentInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AdjustmentInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("AdjustmentInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AdjustmentInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("AdjustmentInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ChargeInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrency = (string) content.GetValueForProperty("ChargeInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ChargeInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrencyValue = (decimal?) content.GetValueForProperty("ChargeInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("ChargeInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("ChargeInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertiesClosedBalanceInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesClosedBalanceInBillingCurrencyCurrency = (string) content.GetValueForProperty("PropertiesClosedBalanceInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesClosedBalanceInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth, (__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 EventSummary(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.Consumption.Models.Api20211001.IEventSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.EventPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Reseller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Reseller = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller) content.GetValueForProperty("Reseller",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Reseller, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResellerTypeConverter.ConvertFrom); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).EventType = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType?) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).EventType, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType.CreateFrom); + } + if (content.Contains("NewCredit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCredit = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("NewCredit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCredit, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Adjustment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Adjustment = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("Adjustment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Adjustment, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("CreditExpired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpired = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CreditExpired",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpired, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Charge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Charge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("Charge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Charge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ClosedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ClosedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("CanceledCredit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CanceledCredit = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CanceledCredit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CanceledCredit, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesCreditExpiredInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesCreditExpiredInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("PropertiesCreditExpiredInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesCreditExpiredInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesNewCreditInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesNewCreditInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("PropertiesNewCreditInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesNewCreditInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("AdjustmentsInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentsInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("AdjustmentsInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentsInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("ChargesInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargesInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("ChargesInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargesInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesClosedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesClosedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("PropertiesClosedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesClosedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("TransactionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).TransactionDate = (global::System.DateTime?) content.GetValueForProperty("TransactionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).TransactionDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("InvoiceNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).InvoiceNumber = (string) content.GetValueForProperty("InvoiceNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).InvoiceNumber, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).BillingProfileDisplayName = (string) content.GetValueForProperty("BillingProfileDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).BillingProfileDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LotId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).LotId = (string) content.GetValueForProperty("LotId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).LotId, global::System.Convert.ToString); + } + if (content.Contains("LotSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).LotSource = (string) content.GetValueForProperty("LotSource",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).LotSource, global::System.Convert.ToString); + } + if (content.Contains("CreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditCurrency = (string) content.GetValueForProperty("CreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("PropertiesETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesETag = (string) content.GetValueForProperty("PropertiesETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesETag, global::System.Convert.ToString); + } + if (content.Contains("ResellerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ResellerId = (string) content.GetValueForProperty("ResellerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ResellerId, global::System.Convert.ToString); + } + if (content.Contains("ResellerDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ResellerDescription = (string) content.GetValueForProperty("ResellerDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ResellerDescription, global::System.Convert.ToString); + } + if (content.Contains("NewCreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditCurrency = (string) content.GetValueForProperty("NewCreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("NewCreditValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditValue = (decimal?) content.GetValueForProperty("NewCreditValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AdjustmentCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentCurrency = (string) content.GetValueForProperty("AdjustmentCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentCurrency, global::System.Convert.ToString); + } + if (content.Contains("AdjustmentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentValue = (decimal?) content.GetValueForProperty("AdjustmentValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredCurrency = (string) content.GetValueForProperty("CreditExpiredCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredCurrency, global::System.Convert.ToString); + } + if (content.Contains("CreditExpiredValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredValue = (decimal?) content.GetValueForProperty("CreditExpiredValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeCurrency = (string) content.GetValueForProperty("ChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("ChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeValue = (decimal?) content.GetValueForProperty("ChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceCurrency = (string) content.GetValueForProperty("ClosedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceValue = (decimal?) content.GetValueForProperty("ClosedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CanceledCreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CanceledCreditCurrency = (string) content.GetValueForProperty("CanceledCreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CanceledCreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("CanceledCreditValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CanceledCreditValue = (decimal?) content.GetValueForProperty("CanceledCreditValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CanceledCreditValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PropertiesCreditExpiredInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesCreditExpiredInBillingCurrencyCurrency = (string) content.GetValueForProperty("PropertiesCreditExpiredInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesCreditExpiredInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("CreditExpiredInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredInBillingCurrencyValue = (decimal?) content.GetValueForProperty("CreditExpiredInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("CreditExpiredInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CreditExpiredInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("CreditExpiredInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).CreditExpiredInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertiesNewCreditInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesNewCreditInBillingCurrencyCurrency = (string) content.GetValueForProperty("PropertiesNewCreditInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesNewCreditInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("NewCreditInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditInBillingCurrencyValue = (decimal?) content.GetValueForProperty("NewCreditInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NewCreditInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("NewCreditInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NewCreditInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("NewCreditInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).NewCreditInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AdjustmentInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrency = (string) content.GetValueForProperty("AdjustmentInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("AdjustmentInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrencyValue = (decimal?) content.GetValueForProperty("AdjustmentInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AdjustmentInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("AdjustmentInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AdjustmentInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("AdjustmentInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).AdjustmentInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ChargeInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrency = (string) content.GetValueForProperty("ChargeInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ChargeInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrencyValue = (decimal?) content.GetValueForProperty("ChargeInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("ChargeInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("ChargeInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ChargeInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertiesClosedBalanceInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesClosedBalanceInBillingCurrencyCurrency = (string) content.GetValueForProperty("PropertiesClosedBalanceInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).PropertiesClosedBalanceInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.Consumption.Models.Api20211001.IEventSummary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An event summary resource. + [System.ComponentModel.TypeConverter(typeof(EventSummaryTypeConverter))] + public partial interface IEventSummary + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/EventSummary.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/EventSummary.TypeConverter.cs new file mode 100644 index 000000000000..c48f7738eb55 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/EventSummary.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventSummaryTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IEventSummary ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventSummary.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventSummary.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventSummary.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/consumption/generated/api/Models/Api20211001/EventSummary.cs b/swaggerci/consumption/generated/api/Models/Api20211001/EventSummary.cs new file mode 100644 index 000000000000..e7e52da393d4 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/EventSummary.cs @@ -0,0 +1,951 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// An event summary resource. + public partial class EventSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ProxyResource(); + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AdjustmentCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentCurrency; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AdjustmentInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentInBillingCurrency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AdjustmentInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentInBillingCurrencyExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? AdjustmentInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentInBillingCurrencyExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AdjustmentInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentInBillingCurrencyValue; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AdjustmentValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentValue; } + + /// The billing currency of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).BillingCurrency; } + + /// + /// The display name of the billing profile for which the event happened. The property is only available for billing account + /// of type MicrosoftCustomerAgreement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingProfileDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).BillingProfileDisplayName; } + + /// + /// The ID that uniquely identifies the billing profile for which the event happened. The property is only available for billing + /// account of type MicrosoftCustomerAgreement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingProfileId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).BillingProfileId; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CanceledCreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CanceledCreditCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CanceledCreditValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CanceledCreditValue; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeCurrency; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ChargeInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeInBillingCurrency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ChargeInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeInBillingCurrencyExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? ChargeInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeInBillingCurrencyExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ChargeInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeInBillingCurrencyValue; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeValue; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ClosedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceCurrency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ClosedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrencyExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? ClosedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrencyExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ClosedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrencyValue; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ClosedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceValue; } + + /// The credit currency of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditCurrency; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CreditExpiredCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredCurrency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CreditExpiredInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrencyExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? CreditExpiredInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrencyExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CreditExpiredInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrencyValue; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CreditExpiredValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredValue; } + + /// The description of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + + /// Identifies the type of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType? EventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).EventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).EventType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType)""); } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + + /// + /// The number which uniquely identifies the invoice on which the event was billed. This will be empty for unbilled events. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InvoiceNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).InvoiceNumber; } + + /// The ID that uniquely identifies the lot for which the event happened. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string LotId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).LotId; } + + /// Identifies the source of the lot for which the event happened. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string LotSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).LotSource; } + + /// Internal Acessors for Adjustment + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.Adjustment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).Adjustment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).Adjustment = value; } + + /// Internal Acessors for AdjustmentCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.AdjustmentCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentCurrency = value; } + + /// Internal Acessors for AdjustmentInBillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.AdjustmentInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentInBillingCurrency = value; } + + /// Internal Acessors for AdjustmentInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.AdjustmentInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentInBillingCurrencyExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentInBillingCurrencyExchangeRate = value; } + + /// Internal Acessors for AdjustmentInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.AdjustmentInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentInBillingCurrencyExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentInBillingCurrencyExchangeRateMonth = value; } + + /// Internal Acessors for AdjustmentInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.AdjustmentInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentInBillingCurrencyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentInBillingCurrencyValue = value; } + + /// Internal Acessors for AdjustmentValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.AdjustmentValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentValue = value; } + + /// Internal Acessors for AdjustmentsInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.AdjustmentsInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentsInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).AdjustmentsInBillingCurrency = value; } + + /// Internal Acessors for BillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.BillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).BillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).BillingCurrency = value; } + + /// Internal Acessors for BillingProfileDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.BillingProfileDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).BillingProfileDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).BillingProfileDisplayName = value; } + + /// Internal Acessors for BillingProfileId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.BillingProfileId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).BillingProfileId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).BillingProfileId = value; } + + /// Internal Acessors for CanceledCredit + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.CanceledCredit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CanceledCredit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CanceledCredit = value; } + + /// Internal Acessors for CanceledCreditCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.CanceledCreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CanceledCreditCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CanceledCreditCurrency = value; } + + /// Internal Acessors for CanceledCreditValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.CanceledCreditValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CanceledCreditValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CanceledCreditValue = value; } + + /// Internal Acessors for Charge + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.Charge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).Charge; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).Charge = value; } + + /// Internal Acessors for ChargeCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeCurrency = value; } + + /// Internal Acessors for ChargeInBillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ChargeInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeInBillingCurrency = value; } + + /// Internal Acessors for ChargeInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ChargeInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeInBillingCurrencyExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeInBillingCurrencyExchangeRate = value; } + + /// Internal Acessors for ChargeInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ChargeInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeInBillingCurrencyExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeInBillingCurrencyExchangeRateMonth = value; } + + /// Internal Acessors for ChargeInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ChargeInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeInBillingCurrencyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeInBillingCurrencyValue = value; } + + /// Internal Acessors for ChargeValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargeValue = value; } + + /// Internal Acessors for ChargesInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ChargesInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargesInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ChargesInBillingCurrency = value; } + + /// Internal Acessors for ClosedBalance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ClosedBalance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalance = value; } + + /// Internal Acessors for ClosedBalanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ClosedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceCurrency = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ClosedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrencyExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrencyExchangeRate = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ClosedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrencyExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrencyExchangeRateMonth = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ClosedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrencyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrencyValue = value; } + + /// Internal Acessors for ClosedBalanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ClosedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceValue = value; } + + /// Internal Acessors for CreditCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.CreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditCurrency = value; } + + /// Internal Acessors for CreditExpired + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.CreditExpired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpired = value; } + + /// Internal Acessors for CreditExpiredCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.CreditExpiredCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredCurrency = value; } + + /// Internal Acessors for CreditExpiredInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.CreditExpiredInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrencyExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrencyExchangeRate = value; } + + /// Internal Acessors for CreditExpiredInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.CreditExpiredInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrencyExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrencyExchangeRateMonth = value; } + + /// Internal Acessors for CreditExpiredInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.CreditExpiredInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrencyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrencyValue = value; } + + /// Internal Acessors for CreditExpiredValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.CreditExpiredValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredValue = value; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).Description = value; } + + /// Internal Acessors for InvoiceNumber + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.InvoiceNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).InvoiceNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).InvoiceNumber = value; } + + /// Internal Acessors for LotId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.LotId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).LotId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).LotId = value; } + + /// Internal Acessors for LotSource + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.LotSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).LotSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).LotSource = value; } + + /// Internal Acessors for NewCredit + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.NewCredit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCredit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCredit = value; } + + /// Internal Acessors for NewCreditCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.NewCreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditCurrency = value; } + + /// Internal Acessors for NewCreditInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.NewCreditInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrencyExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrencyExchangeRate = value; } + + /// Internal Acessors for NewCreditInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.NewCreditInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrencyExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrencyExchangeRateMonth = value; } + + /// Internal Acessors for NewCreditInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.NewCreditInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrencyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrencyValue = value; } + + /// Internal Acessors for NewCreditValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.NewCreditValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditValue = value; } + + /// Internal Acessors for PropertiesClosedBalanceInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.PropertiesClosedBalanceInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrency = value; } + + /// Internal Acessors for PropertiesClosedBalanceInBillingCurrencyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.PropertiesClosedBalanceInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrencyCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrencyCurrency = value; } + + /// Internal Acessors for PropertiesCreditExpiredInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.PropertiesCreditExpiredInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrency = value; } + + /// Internal Acessors for PropertiesCreditExpiredInBillingCurrencyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.PropertiesCreditExpiredInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrencyCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrencyCurrency = value; } + + /// Internal Acessors for PropertiesETag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.PropertiesETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ETag = value; } + + /// Internal Acessors for PropertiesNewCreditInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.PropertiesNewCreditInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrency = value; } + + /// Internal Acessors for PropertiesNewCreditInBillingCurrencyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.PropertiesNewCreditInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrencyCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrencyCurrency = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.EventProperties()); set { {_property = value;} } } + + /// Internal Acessors for Reseller + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.Reseller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).Reseller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).Reseller = value; } + + /// Internal Acessors for ResellerDescription + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ResellerDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ResellerDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ResellerDescription = value; } + + /// Internal Acessors for ResellerId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.ResellerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ResellerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ResellerId = value; } + + /// Internal Acessors for TransactionDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummaryInternal.TransactionDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).TransactionDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).TransactionDate = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string NewCreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditCurrency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? NewCreditInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrencyExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? NewCreditInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrencyExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? NewCreditInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrencyValue; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? NewCreditValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditValue; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PropertiesClosedBalanceInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ClosedBalanceInBillingCurrencyCurrency; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PropertiesCreditExpiredInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).CreditExpiredInBillingCurrencyCurrency; } + + /// The eTag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PropertiesETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ETag; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PropertiesNewCreditInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).NewCreditInBillingCurrencyCurrency; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventProperties _property; + + /// The event properties. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.EventProperties()); set => this._property = value; } + + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ResellerDescription; } + + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).ResellerId; } + + /// The date of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? TransactionDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventPropertiesInternal)Property).TransactionDate; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public EventSummary() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// An event summary resource. + public partial interface IEventSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource + { + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string AdjustmentCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string AdjustmentInBillingCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AdjustmentInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? AdjustmentInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AdjustmentInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AdjustmentValue { get; } + /// The billing currency of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing currency of the event.", + SerializedName = @"billingCurrency", + PossibleTypes = new [] { typeof(string) })] + string BillingCurrency { get; } + /// + /// The display name of the billing profile for which the event happened. The property is only available for billing account + /// of type MicrosoftCustomerAgreement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The display name of the billing profile for which the event happened. The property is only available for billing account of type MicrosoftCustomerAgreement.", + SerializedName = @"billingProfileDisplayName", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileDisplayName { get; } + /// + /// The ID that uniquely identifies the billing profile for which the event happened. The property is only available for billing + /// account of type MicrosoftCustomerAgreement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ID that uniquely identifies the billing profile for which the event happened. The property is only available for billing account of type MicrosoftCustomerAgreement. ", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileId { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string CanceledCreditCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CanceledCreditValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ChargeCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ChargeInBillingCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargeInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? ChargeInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargeInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargeValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ClosedBalanceCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ClosedBalanceInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? ClosedBalanceInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ClosedBalanceInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ClosedBalanceValue { get; } + /// The credit currency of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The credit currency of the event.", + SerializedName = @"creditCurrency", + PossibleTypes = new [] { typeof(string) })] + string CreditCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string CreditExpiredCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CreditExpiredInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? CreditExpiredInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CreditExpiredInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CreditExpiredValue { get; } + /// The description of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The description of the event.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// Identifies the type of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifies the type of the event.", + SerializedName = @"eventType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType? EventType { get; set; } + /// + /// The number which uniquely identifies the invoice on which the event was billed. This will be empty for unbilled events. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The number which uniquely identifies the invoice on which the event was billed. This will be empty for unbilled events.", + SerializedName = @"invoiceNumber", + PossibleTypes = new [] { typeof(string) })] + string InvoiceNumber { get; } + /// The ID that uniquely identifies the lot for which the event happened. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ID that uniquely identifies the lot for which the event happened.", + SerializedName = @"lotId", + PossibleTypes = new [] { typeof(string) })] + string LotId { get; } + /// Identifies the source of the lot for which the event happened. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifies the source of the lot for which the event happened. ", + SerializedName = @"lotSource", + PossibleTypes = new [] { typeof(string) })] + string LotSource { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string NewCreditCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? NewCreditInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? NewCreditInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? NewCreditInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? NewCreditValue { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string PropertiesClosedBalanceInBillingCurrencyCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string PropertiesCreditExpiredInBillingCurrencyCurrency { get; } + /// The eTag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The eTag for the resource.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + string PropertiesETag { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string PropertiesNewCreditInBillingCurrencyCurrency { get; } + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property description.", + SerializedName = @"resellerDescription", + PossibleTypes = new [] { typeof(string) })] + string ResellerDescription { get; } + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property ID.", + SerializedName = @"resellerId", + PossibleTypes = new [] { typeof(string) })] + string ResellerId { get; } + /// The date of the event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date of the event.", + SerializedName = @"transactionDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TransactionDate { get; } + + } + /// An event summary resource. + internal partial interface IEventSummaryInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal + { + /// + /// The amount of balance adjustment. The property is not available for ConsumptionCommitment lots. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Adjustment { get; set; } + /// Amount currency. + string AdjustmentCurrency { get; set; } + /// Amount currency. + string AdjustmentInBillingCurrency { get; set; } + /// The exchange rate. + decimal? AdjustmentInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? AdjustmentInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? AdjustmentInBillingCurrencyValue { get; set; } + /// Amount. + decimal? AdjustmentValue { get; set; } + /// The amount of balance adjustment in billing currency. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate AdjustmentsInBillingCurrency { get; set; } + /// The billing currency of the event. + string BillingCurrency { get; set; } + /// + /// The display name of the billing profile for which the event happened. The property is only available for billing account + /// of type MicrosoftCustomerAgreement. + /// + string BillingProfileDisplayName { get; set; } + /// + /// The ID that uniquely identifies the billing profile for which the event happened. The property is only available for billing + /// account of type MicrosoftCustomerAgreement. + /// + string BillingProfileId { get; set; } + /// Amount of canceled credit. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CanceledCredit { get; set; } + /// Amount currency. + string CanceledCreditCurrency { get; set; } + /// Amount. + decimal? CanceledCreditValue { get; set; } + /// + /// The amount of charges for events of type SettleCharges and PendingEligibleCharges. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Charge { get; set; } + /// Amount currency. + string ChargeCurrency { get; set; } + /// Amount currency. + string ChargeInBillingCurrency { get; set; } + /// The exchange rate. + decimal? ChargeInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? ChargeInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? ChargeInBillingCurrencyValue { get; set; } + /// Amount. + decimal? ChargeValue { get; set; } + /// + /// The amount of charges for events of type SettleCharges and PendingEligibleCharges in billing currency. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate ChargesInBillingCurrency { get; set; } + /// The balance after the event. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount ClosedBalance { get; set; } + /// Amount currency. + string ClosedBalanceCurrency { get; set; } + /// The exchange rate. + decimal? ClosedBalanceInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? ClosedBalanceInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? ClosedBalanceInBillingCurrencyValue { get; set; } + /// Amount. + decimal? ClosedBalanceValue { get; set; } + /// The credit currency of the event. + string CreditCurrency { get; set; } + /// + /// The amount of expired credit or commitment for NewCredit or SettleCharges event. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CreditExpired { get; set; } + /// Amount currency. + string CreditExpiredCurrency { get; set; } + /// The exchange rate. + decimal? CreditExpiredInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? CreditExpiredInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? CreditExpiredInBillingCurrencyValue { get; set; } + /// Amount. + decimal? CreditExpiredValue { get; set; } + /// The description of the event. + string Description { get; set; } + /// Identifies the type of the event. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType? EventType { get; set; } + /// + /// The number which uniquely identifies the invoice on which the event was billed. This will be empty for unbilled events. + /// + string InvoiceNumber { get; set; } + /// The ID that uniquely identifies the lot for which the event happened. + string LotId { get; set; } + /// Identifies the source of the lot for which the event happened. + string LotSource { get; set; } + /// The amount of new credit or commitment for NewCredit or SettleCharges event. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount NewCredit { get; set; } + /// Amount currency. + string NewCreditCurrency { get; set; } + /// The exchange rate. + decimal? NewCreditInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? NewCreditInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? NewCreditInBillingCurrencyValue { get; set; } + /// Amount. + decimal? NewCreditValue { get; set; } + /// The balance in billing currency after the event. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate PropertiesClosedBalanceInBillingCurrency { get; set; } + /// Amount currency. + string PropertiesClosedBalanceInBillingCurrencyCurrency { get; set; } + /// + /// The amount of expired credit or commitment for NewCredit or SettleCharges event in billing currency. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate PropertiesCreditExpiredInBillingCurrency { get; set; } + /// Amount currency. + string PropertiesCreditExpiredInBillingCurrencyCurrency { get; set; } + /// The eTag for the resource. + string PropertiesETag { get; set; } + /// + /// The amount of new credit or commitment for NewCredit or SettleCharges event in billing currency. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate PropertiesNewCreditInBillingCurrency { get; set; } + /// Amount currency. + string PropertiesNewCreditInBillingCurrencyCurrency { get; set; } + /// The event properties. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventProperties Property { get; set; } + /// The reseller of the event. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Reseller { get; set; } + /// The reseller property description. + string ResellerDescription { get; set; } + /// The reseller property ID. + string ResellerId { get; set; } + /// The date of the event. + global::System.DateTime? TransactionDate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/EventSummary.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/EventSummary.json.cs new file mode 100644 index 000000000000..19b4c6b7f9ed --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/EventSummary.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// An event summary resource. + public partial class EventSummary + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal EventSummary(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.EventProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new EventSummary(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/Events.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Events.PowerShell.cs new file mode 100644 index 000000000000..f7e893519203 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Events.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Result of listing event summary. + [System.ComponentModel.TypeConverter(typeof(EventsTypeConverter))] + public partial class Events + { + + /// + /// 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.Consumption.Models.Api20211001.IEvents DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Events(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.Consumption.Models.Api20211001.IEvents DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Events(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Events(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.Consumption.Models.Api20211001.IEventsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.EventSummaryTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventsInternal)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 Events(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.Consumption.Models.Api20211001.IEventsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.EventSummaryTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventsInternal)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.Consumption.Models.Api20211001.IEvents FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing event summary. + [System.ComponentModel.TypeConverter(typeof(EventsTypeConverter))] + public partial interface IEvents + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Events.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Events.TypeConverter.cs new file mode 100644 index 000000000000..3ba101ed6f0f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Events.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventsTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IEvents ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEvents).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Events.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Events.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Events.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/consumption/generated/api/Models/Api20211001/Events.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Events.cs new file mode 100644 index 000000000000..e403ecb44e01 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Events.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing event summary. + public partial class Events : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEvents, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventsInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventsInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventsInternal.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary[] _value; + + /// The list of event summary. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary[] Value { get => this._value; } + + /// Creates an new instance. + public Events() + { + + } + } + /// Result of listing event summary. + public partial interface IEvents : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 event summary. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of event summary.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary[] Value { get; } + + } + /// Result of listing event summary. + internal partial interface IEventsInternal + + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The list of event summary. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Events.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Events.json.cs new file mode 100644 index 000000000000..0947829cb3d0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Events.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing event summary. + public partial class Events + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal Events(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IEventSummary) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.EventSummary.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.Consumption.Models.Api20211001.IEvents. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEvents. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEvents FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new Events(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ForecastSpend.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ForecastSpend.PowerShell.cs new file mode 100644 index 000000000000..a11655614084 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ForecastSpend.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The forecasted cost which is being tracked for a budget. + [System.ComponentModel.TypeConverter(typeof(ForecastSpendTypeConverter))] + public partial class ForecastSpend + { + + /// + /// 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.Consumption.Models.Api20211001.IForecastSpend DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ForecastSpend(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.Consumption.Models.Api20211001.IForecastSpend DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ForecastSpend(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ForecastSpend(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)this).Unit, 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 ForecastSpend(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal)this).Unit, 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.Consumption.Models.Api20211001.IForecastSpend FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The forecasted cost which is being tracked for a budget. + [System.ComponentModel.TypeConverter(typeof(ForecastSpendTypeConverter))] + public partial interface IForecastSpend + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ForecastSpend.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ForecastSpend.TypeConverter.cs new file mode 100644 index 000000000000..f071184649fd --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ForecastSpend.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ForecastSpendTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IForecastSpend ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ForecastSpend.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ForecastSpend.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ForecastSpend.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/consumption/generated/api/Models/Api20211001/ForecastSpend.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ForecastSpend.cs new file mode 100644 index 000000000000..67cfefc4d45b --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ForecastSpend.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The forecasted cost which is being tracked for a budget. + public partial class ForecastSpend : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal + { + + /// Backing field for property. + private decimal? _amount; + + /// + /// The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the + /// budget contains a forecast alert type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Amount { get => this._amount; } + + /// Internal Acessors for Amount + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal.Amount { get => this._amount; set { {_amount = value;} } } + + /// Internal Acessors for Unit + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpendInternal.Unit { get => this._unit; set { {_unit = value;} } } + + /// Backing field for property. + private string _unit; + + /// The unit of measure for the budget amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Unit { get => this._unit; } + + /// Creates an new instance. + public ForecastSpend() + { + + } + } + /// The forecasted cost which is being tracked for a budget. + public partial interface IForecastSpend : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// + /// The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the + /// budget contains a forecast alert type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the budget contains a forecast alert type.", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Amount { get; } + /// The unit of measure for the budget amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit of measure for the budget amount.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string Unit { get; } + + } + /// The forecasted cost which is being tracked for a budget. + internal partial interface IForecastSpendInternal + + { + /// + /// The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the + /// budget contains a forecast alert type. + /// + decimal? Amount { get; set; } + /// The unit of measure for the budget amount. + string Unit { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ForecastSpend.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ForecastSpend.json.cs new file mode 100644 index 000000000000..0229736b7897 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ForecastSpend.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The forecasted cost which is being tracked for a budget. + public partial class ForecastSpend + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ForecastSpend(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (decimal?)__jsonAmount : Amount;} + {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IForecastSpend FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ForecastSpend(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._amount ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._amount) : null, "amount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorDetails.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorDetails.PowerShell.cs new file mode 100644 index 000000000000..edfab096f331 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorDetails.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The details of the error. + [System.ComponentModel.TypeConverter(typeof(HighCasedErrorDetailsTypeConverter))] + public partial class HighCasedErrorDetails + { + + /// + /// 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.Consumption.Models.Api20211001.IHighCasedErrorDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new HighCasedErrorDetails(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.Consumption.Models.Api20211001.IHighCasedErrorDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new HighCasedErrorDetails(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.Consumption.Models.Api20211001.IHighCasedErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal HighCasedErrorDetails(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.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)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 HighCasedErrorDetails(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.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The details of the error. + [System.ComponentModel.TypeConverter(typeof(HighCasedErrorDetailsTypeConverter))] + public partial interface IHighCasedErrorDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorDetails.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorDetails.TypeConverter.cs new file mode 100644 index 000000000000..c30584287a2a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorDetails.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class HighCasedErrorDetailsTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IHighCasedErrorDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return HighCasedErrorDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return HighCasedErrorDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return HighCasedErrorDetails.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/consumption/generated/api/Models/Api20211001/HighCasedErrorDetails.cs b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorDetails.cs new file mode 100644 index 000000000000..430108f015a5 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorDetails.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The details of the error. + public partial class HighCasedErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetails, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal + { + + /// Backing field for property. + private string _code; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal.Message { get => this._message; set { {_message = value;} } } + + /// Creates an new instance. + public HighCasedErrorDetails() + { + + } + } + /// The details of the error. + public partial interface IHighCasedErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 IHighCasedErrorDetailsInternal + + { + /// 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/consumption/generated/api/Models/Api20211001/HighCasedErrorDetails.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorDetails.json.cs new file mode 100644 index 000000000000..76a4fccbea35 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorDetails.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The details of the error. + public partial class HighCasedErrorDetails + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new HighCasedErrorDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal HighCasedErrorDetails(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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); + } + + /// + /// 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/HighCasedErrorResponse.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..6463b6492fa0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorResponse.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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(HighCasedErrorResponseTypeConverter))] + public partial class HighCasedErrorResponse + { + + /// + /// 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.Consumption.Models.Api20211001.IHighCasedErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new HighCasedErrorResponse(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.Consumption.Models.Api20211001.IHighCasedErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new HighCasedErrorResponse(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.Consumption.Models.Api20211001.IHighCasedErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal HighCasedErrorResponse(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.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.HighCasedErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal)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 HighCasedErrorResponse(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.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.HighCasedErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal)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.Consumption.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(HighCasedErrorResponseTypeConverter))] + public partial interface IHighCasedErrorResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorResponse.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..1a52d8540d76 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorResponse.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class HighCasedErrorResponseTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IHighCasedErrorResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return HighCasedErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return HighCasedErrorResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return HighCasedErrorResponse.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/consumption/generated/api/Models/Api20211001/HighCasedErrorResponse.cs b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorResponse.cs new file mode 100644 index 000000000000..3de13e706e80 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorResponse.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 HighCasedErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal + { + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)Error).Code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetails _error; + + /// The details of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.HighCasedErrorDetails()); set => this._error = value; } + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)Error).Message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)Error).Code = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetails Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.HighCasedErrorDetails()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetailsInternal)Error).Message = value; } + + /// Creates an new instance. + public HighCasedErrorResponse() + { + + } + } + /// 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 IHighCasedErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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 IHighCasedErrorResponseInternal + + { + /// Error code. + string Code { get; set; } + /// The details of the error. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorDetails Error { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorResponse.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorResponse.json.cs new file mode 100644 index 000000000000..f1af957c0b72 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/HighCasedErrorResponse.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 HighCasedErrorResponse + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IHighCasedErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new HighCasedErrorResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal HighCasedErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.HighCasedErrorDetails.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/LegacyChargeSummary.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummary.PowerShell.cs new file mode 100644 index 000000000000..1f4d248404df --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummary.PowerShell.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Legacy charge summary. + [System.ComponentModel.TypeConverter(typeof(LegacyChargeSummaryTypeConverter))] + public partial class LegacyChargeSummary + { + + /// + /// 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.Consumption.Models.Api20211001.ILegacyChargeSummary DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LegacyChargeSummary(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.Consumption.Models.Api20211001.ILegacyChargeSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LegacyChargeSummary(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.Consumption.Models.Api20211001.ILegacyChargeSummary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LegacyChargeSummary(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.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyChargeSummaryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind.CreateFrom); + } + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).UsageStart = (string) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).UsageStart, global::System.Convert.ToString); + } + if (content.Contains("UsageEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).UsageEnd = (string) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).UsageEnd, global::System.Convert.ToString); + } + if (content.Contains("AzureCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).AzureCharge = (decimal?) content.GetValueForProperty("AzureCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).AzureCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).ChargesBilledSeparately = (decimal?) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).ChargesBilledSeparately, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AzureMarketplaceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).AzureMarketplaceCharge = (decimal?) content.GetValueForProperty("AzureMarketplaceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).AzureMarketplaceCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).Currency, 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 LegacyChargeSummary(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.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyChargeSummaryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind.CreateFrom); + } + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).UsageStart = (string) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).UsageStart, global::System.Convert.ToString); + } + if (content.Contains("UsageEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).UsageEnd = (string) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).UsageEnd, global::System.Convert.ToString); + } + if (content.Contains("AzureCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).AzureCharge = (decimal?) content.GetValueForProperty("AzureCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).AzureCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).ChargesBilledSeparately = (decimal?) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).ChargesBilledSeparately, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AzureMarketplaceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).AzureMarketplaceCharge = (decimal?) content.GetValueForProperty("AzureMarketplaceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).AzureMarketplaceCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal)this).Currency, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Legacy charge summary. + [System.ComponentModel.TypeConverter(typeof(LegacyChargeSummaryTypeConverter))] + public partial interface ILegacyChargeSummary + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummary.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummary.TypeConverter.cs new file mode 100644 index 000000000000..d63df8b2ec26 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummary.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LegacyChargeSummaryTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILegacyChargeSummary ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummary).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LegacyChargeSummary.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LegacyChargeSummary.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LegacyChargeSummary.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/consumption/generated/api/Models/Api20211001/LegacyChargeSummary.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummary.cs new file mode 100644 index 000000000000..b0799d93897c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummary.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Legacy charge summary. + public partial class LegacyChargeSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummary, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary __chargeSummary = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ChargeSummary(); + + /// Azure Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AzureCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).AzureCharge; } + + /// Marketplace Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AzureMarketplaceCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).AzureMarketplaceCharge; } + + /// The id of the billing period resource that the charge belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingPeriodId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).BillingPeriodId; } + + /// Charges Billed separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ChargesBilledSeparately { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).ChargesBilledSeparately; } + + /// Currency Code + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).Currency; } + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Etag; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Id; } + + /// Specifies the kind of charge summary. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)__chargeSummary).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)__chargeSummary).Kind = value ; } + + /// Internal Acessors for AzureCharge + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal.AzureCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).AzureCharge; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).AzureCharge = value; } + + /// Internal Acessors for AzureMarketplaceCharge + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal.AzureMarketplaceCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).AzureMarketplaceCharge; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).AzureMarketplaceCharge = value; } + + /// Internal Acessors for BillingPeriodId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal.BillingPeriodId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).BillingPeriodId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).BillingPeriodId = value; } + + /// Internal Acessors for ChargesBilledSeparately + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal.ChargesBilledSeparately { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).ChargesBilledSeparately; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).ChargesBilledSeparately = value; } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal.Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).Currency = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyChargeSummaryProperties()); set { {_property = value;} } } + + /// Internal Acessors for UsageEnd + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal.UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).UsageEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).UsageEnd = value; } + + /// Internal Acessors for UsageStart + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryInternal.UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).UsageStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).UsageStart = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties _property; + + /// Properties for legacy charge summary + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyChargeSummaryProperties()); set => this._property = value; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Tag; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Type; } + + /// Usage end date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).UsageEnd; } + + /// Usage start date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)Property).UsageStart; } + + /// Creates an new instance. + public LegacyChargeSummary() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__chargeSummary), __chargeSummary); + await eventListener.AssertObjectIsValid(nameof(__chargeSummary), __chargeSummary); + } + } + /// Legacy charge summary. + public partial interface ILegacyChargeSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary + { + /// Azure Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure Charges.", + SerializedName = @"azureCharges", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AzureCharge { get; } + /// Marketplace Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Marketplace Charges.", + SerializedName = @"azureMarketplaceCharges", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AzureMarketplaceCharge { get; } + /// The id of the billing period resource that the charge belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The id of the billing period resource that the charge belongs to.", + SerializedName = @"billingPeriodId", + PossibleTypes = new [] { typeof(string) })] + string BillingPeriodId { get; } + /// Charges Billed separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Charges Billed separately.", + SerializedName = @"chargesBilledSeparately", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargesBilledSeparately { get; } + /// Currency Code + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Currency Code", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// Usage end date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Usage end date.", + SerializedName = @"usageEnd", + PossibleTypes = new [] { typeof(string) })] + string UsageEnd { get; } + /// Usage start date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Usage start date.", + SerializedName = @"usageStart", + PossibleTypes = new [] { typeof(string) })] + string UsageStart { get; } + + } + /// Legacy charge summary. + internal partial interface ILegacyChargeSummaryInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal + { + /// Azure Charges. + decimal? AzureCharge { get; set; } + /// Marketplace Charges. + decimal? AzureMarketplaceCharge { get; set; } + /// The id of the billing period resource that the charge belongs to. + string BillingPeriodId { get; set; } + /// Charges Billed separately. + decimal? ChargesBilledSeparately { get; set; } + /// Currency Code + string Currency { get; set; } + /// Properties for legacy charge summary + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties Property { get; set; } + /// Usage end date. + string UsageEnd { get; set; } + /// Usage start date. + string UsageStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummary.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummary.json.cs new file mode 100644 index 000000000000..3ec728785dca --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummary.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Legacy charge summary. + public partial class LegacyChargeSummary + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummary. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummary. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummary FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new LegacyChargeSummary(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal LegacyChargeSummary(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __chargeSummary = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ChargeSummary(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyChargeSummaryProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __chargeSummary?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/LegacyChargeSummaryProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummaryProperties.PowerShell.cs new file mode 100644 index 000000000000..cd7aef63e728 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummaryProperties.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of legacy charge summary. + [System.ComponentModel.TypeConverter(typeof(LegacyChargeSummaryPropertiesTypeConverter))] + public partial class LegacyChargeSummaryProperties + { + + /// + /// 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.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LegacyChargeSummaryProperties(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.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LegacyChargeSummaryProperties(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.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LegacyChargeSummaryProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).UsageStart = (string) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).UsageStart, global::System.Convert.ToString); + } + if (content.Contains("UsageEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).UsageEnd = (string) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).UsageEnd, global::System.Convert.ToString); + } + if (content.Contains("AzureCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).AzureCharge = (decimal?) content.GetValueForProperty("AzureCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).AzureCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).ChargesBilledSeparately = (decimal?) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).ChargesBilledSeparately, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AzureMarketplaceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).AzureMarketplaceCharge = (decimal?) content.GetValueForProperty("AzureMarketplaceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).AzureMarketplaceCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).Currency, 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 LegacyChargeSummaryProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).UsageStart = (string) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).UsageStart, global::System.Convert.ToString); + } + if (content.Contains("UsageEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).UsageEnd = (string) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).UsageEnd, global::System.Convert.ToString); + } + if (content.Contains("AzureCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).AzureCharge = (decimal?) content.GetValueForProperty("AzureCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).AzureCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).ChargesBilledSeparately = (decimal?) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).ChargesBilledSeparately, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AzureMarketplaceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).AzureMarketplaceCharge = (decimal?) content.GetValueForProperty("AzureMarketplaceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).AzureMarketplaceCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal)this).Currency, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of legacy charge summary. + [System.ComponentModel.TypeConverter(typeof(LegacyChargeSummaryPropertiesTypeConverter))] + public partial interface ILegacyChargeSummaryProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummaryProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummaryProperties.TypeConverter.cs new file mode 100644 index 000000000000..6634b99a148a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummaryProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LegacyChargeSummaryPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LegacyChargeSummaryProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LegacyChargeSummaryProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LegacyChargeSummaryProperties.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/consumption/generated/api/Models/Api20211001/LegacyChargeSummaryProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummaryProperties.cs new file mode 100644 index 000000000000..55f9c854c0c5 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummaryProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of legacy charge summary. + public partial class LegacyChargeSummaryProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal + { + + /// Backing field for property. + private decimal? _azureCharge; + + /// Azure Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? AzureCharge { get => this._azureCharge; } + + /// Backing field for property. + private decimal? _azureMarketplaceCharge; + + /// Marketplace Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? AzureMarketplaceCharge { get => this._azureMarketplaceCharge; } + + /// Backing field for property. + private string _billingPeriodId; + + /// The id of the billing period resource that the charge belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingPeriodId { get => this._billingPeriodId; } + + /// Backing field for property. + private decimal? _chargesBilledSeparately; + + /// Charges Billed separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? ChargesBilledSeparately { get => this._chargesBilledSeparately; } + + /// Backing field for property. + private string _currency; + + /// Currency Code + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Currency { get => this._currency; } + + /// Internal Acessors for AzureCharge + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal.AzureCharge { get => this._azureCharge; set { {_azureCharge = value;} } } + + /// Internal Acessors for AzureMarketplaceCharge + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal.AzureMarketplaceCharge { get => this._azureMarketplaceCharge; set { {_azureMarketplaceCharge = value;} } } + + /// Internal Acessors for BillingPeriodId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal.BillingPeriodId { get => this._billingPeriodId; set { {_billingPeriodId = value;} } } + + /// Internal Acessors for ChargesBilledSeparately + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal.ChargesBilledSeparately { get => this._chargesBilledSeparately; set { {_chargesBilledSeparately = value;} } } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal.Currency { get => this._currency; set { {_currency = value;} } } + + /// Internal Acessors for UsageEnd + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal.UsageEnd { get => this._usageEnd; set { {_usageEnd = value;} } } + + /// Internal Acessors for UsageStart + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryPropertiesInternal.UsageStart { get => this._usageStart; set { {_usageStart = value;} } } + + /// Backing field for property. + private string _usageEnd; + + /// Usage end date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string UsageEnd { get => this._usageEnd; } + + /// Backing field for property. + private string _usageStart; + + /// Usage start date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string UsageStart { get => this._usageStart; } + + /// Creates an new instance. + public LegacyChargeSummaryProperties() + { + + } + } + /// The properties of legacy charge summary. + public partial interface ILegacyChargeSummaryProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Azure Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure Charges.", + SerializedName = @"azureCharges", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AzureCharge { get; } + /// Marketplace Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Marketplace Charges.", + SerializedName = @"azureMarketplaceCharges", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AzureMarketplaceCharge { get; } + /// The id of the billing period resource that the charge belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The id of the billing period resource that the charge belongs to.", + SerializedName = @"billingPeriodId", + PossibleTypes = new [] { typeof(string) })] + string BillingPeriodId { get; } + /// Charges Billed separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Charges Billed separately.", + SerializedName = @"chargesBilledSeparately", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargesBilledSeparately { get; } + /// Currency Code + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Currency Code", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// Usage end date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Usage end date.", + SerializedName = @"usageEnd", + PossibleTypes = new [] { typeof(string) })] + string UsageEnd { get; } + /// Usage start date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Usage start date.", + SerializedName = @"usageStart", + PossibleTypes = new [] { typeof(string) })] + string UsageStart { get; } + + } + /// The properties of legacy charge summary. + internal partial interface ILegacyChargeSummaryPropertiesInternal + + { + /// Azure Charges. + decimal? AzureCharge { get; set; } + /// Marketplace Charges. + decimal? AzureMarketplaceCharge { get; set; } + /// The id of the billing period resource that the charge belongs to. + string BillingPeriodId { get; set; } + /// Charges Billed separately. + decimal? ChargesBilledSeparately { get; set; } + /// Currency Code + string Currency { get; set; } + /// Usage end date. + string UsageEnd { get; set; } + /// Usage start date. + string UsageStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummaryProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummaryProperties.json.cs new file mode 100644 index 000000000000..265bae09b7eb --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyChargeSummaryProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of legacy charge summary. + public partial class LegacyChargeSummaryProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyChargeSummaryProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new LegacyChargeSummaryProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal LegacyChargeSummaryProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_billingPeriodId = If( json?.PropertyT("billingPeriodId"), out var __jsonBillingPeriodId) ? (string)__jsonBillingPeriodId : (string)BillingPeriodId;} + {_usageStart = If( json?.PropertyT("usageStart"), out var __jsonUsageStart) ? (string)__jsonUsageStart : (string)UsageStart;} + {_usageEnd = If( json?.PropertyT("usageEnd"), out var __jsonUsageEnd) ? (string)__jsonUsageEnd : (string)UsageEnd;} + {_azureCharge = If( json?.PropertyT("azureCharges"), out var __jsonAzureCharges) ? (decimal?)__jsonAzureCharges : AzureCharge;} + {_chargesBilledSeparately = If( json?.PropertyT("chargesBilledSeparately"), out var __jsonChargesBilledSeparately) ? (decimal?)__jsonChargesBilledSeparately : ChargesBilledSeparately;} + {_azureMarketplaceCharge = If( json?.PropertyT("azureMarketplaceCharges"), out var __jsonAzureMarketplaceCharges) ? (decimal?)__jsonAzureMarketplaceCharges : AzureMarketplaceCharge;} + {_currency = If( json?.PropertyT("currency"), out var __jsonCurrency) ? (string)__jsonCurrency : (string)Currency;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingPeriodId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingPeriodId.ToString()) : null, "billingPeriodId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._usageStart)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._usageStart.ToString()) : null, "usageStart" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._usageEnd)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._usageEnd.ToString()) : null, "usageEnd" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._azureCharge ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._azureCharge) : null, "azureCharges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._chargesBilledSeparately ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._chargesBilledSeparately) : null, "chargesBilledSeparately" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._azureMarketplaceCharge ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._azureMarketplaceCharge) : null, "azureMarketplaceCharges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._currency.ToString()) : null, "currency" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendation.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendation.PowerShell.cs new file mode 100644 index 000000000000..c2ea2fad391c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendation.PowerShell.cs @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Legacy reservation recommendation. + [System.ComponentModel.TypeConverter(typeof(LegacyReservationRecommendationTypeConverter))] + public partial class LegacyReservationRecommendation + { + + /// + /// 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.Consumption.Models.Api20211001.ILegacyReservationRecommendation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LegacyReservationRecommendation(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.Consumption.Models.Api20211001.ILegacyReservationRecommendation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LegacyReservationRecommendation(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.Consumption.Models.Api20211001.ILegacyReservationRecommendation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LegacyReservationRecommendation(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.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind.CreateFrom); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).LookBackPeriod = (string) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).LookBackPeriod, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).CostWithNoReservedInstance = (decimal?) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).CostWithNoReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).TotalCostWithReservedInstance = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).TotalCostWithReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).NetSaving = (decimal?) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).NetSaving, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LegacyReservationRecommendation(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.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind.CreateFrom); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).LookBackPeriod = (string) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).LookBackPeriod, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).CostWithNoReservedInstance = (decimal?) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).CostWithNoReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).TotalCostWithReservedInstance = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).TotalCostWithReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).NetSaving = (decimal?) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).NetSaving, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Legacy reservation recommendation. + [System.ComponentModel.TypeConverter(typeof(LegacyReservationRecommendationTypeConverter))] + public partial interface ILegacyReservationRecommendation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendation.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendation.TypeConverter.cs new file mode 100644 index 000000000000..45011e1309db --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendation.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LegacyReservationRecommendationTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILegacyReservationRecommendation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LegacyReservationRecommendation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LegacyReservationRecommendation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LegacyReservationRecommendation.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/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendation.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendation.cs new file mode 100644 index 000000000000..30a4fbceb591 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendation.cs @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Legacy reservation recommendation. + public partial class LegacyReservationRecommendation : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendation, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation __reservationRecommendation = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendation(); + + /// The total amount of cost without reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CostWithNoReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).CostWithNoReservedInstance; } + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Etag; } + + /// The usage date for looking back. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? FirstUsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).FirstUsageDate; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Id; } + + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).InstanceFlexibilityGroup; } + + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public float? InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).InstanceFlexibilityRatio; } + + /// Specifies the kind of reservation recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)__reservationRecommendation).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)__reservationRecommendation).Kind = value ; } + + /// Resource location + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__reservationRecommendation).Location; } + + /// The number of days of usage to look back for recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string LookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).LookBackPeriod; } + + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).MeterId; } + + /// Internal Acessors for CostWithNoReservedInstance + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.CostWithNoReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).CostWithNoReservedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).CostWithNoReservedInstance = value; } + + /// Internal Acessors for FirstUsageDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.FirstUsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).FirstUsageDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).FirstUsageDate = value; } + + /// Internal Acessors for InstanceFlexibilityGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).InstanceFlexibilityGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).InstanceFlexibilityGroup = value; } + + /// Internal Acessors for InstanceFlexibilityRatio + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).InstanceFlexibilityRatio; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).InstanceFlexibilityRatio = value; } + + /// Internal Acessors for LookBackPeriod + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.LookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).LookBackPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).LookBackPeriod = value; } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).MeterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).MeterId = value; } + + /// Internal Acessors for NetSaving + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.NetSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).NetSaving; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).NetSaving = value; } + + /// Internal Acessors for NormalizedSize + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.NormalizedSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).NormalizedSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).NormalizedSize = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendationProperties()); set { {_property = value;} } } + + /// Internal Acessors for RecommendedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.RecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).RecommendedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).RecommendedQuantity = value; } + + /// Internal Acessors for RecommendedQuantityNormalized + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.RecommendedQuantityNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).RecommendedQuantityNormalized; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).RecommendedQuantityNormalized = value; } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).ResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).ResourceType = value; } + + /// Internal Acessors for SkuProperty + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.SkuProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).SkuProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).SkuProperty = value; } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).Term = value; } + + /// Internal Acessors for TotalCostWithReservedInstance + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationInternal.TotalCostWithReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).TotalCostWithReservedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).TotalCostWithReservedInstance = value; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__reservationRecommendation).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__reservationRecommendation).Location = value; } + + /// Internal Acessors for Sku + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__reservationRecommendation).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__reservationRecommendation).Sku = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Name; } + + /// Total estimated savings with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? NetSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).NetSaving; } + + /// The normalized Size. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string NormalizedSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).NormalizedSize; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties _property; + + /// Properties for legacy reservation recommendation + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendationProperties()); set => this._property = value; } + + /// Recommended quality for reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? RecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).RecommendedQuantity; } + + /// The recommended Quantity Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public float? RecommendedQuantityNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).RecommendedQuantityNormalized; } + + /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).ResourceType; } + + /// Shared or single recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).Scope = value ; } + + /// Resource sku + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__reservationRecommendation).Sku; } + + /// List of sku properties + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).SkuProperty; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Tag; } + + /// RI recommendations in one or three year terms. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).Term; } + + /// The total amount of cost with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? TotalCostWithReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)Property).TotalCostWithReservedInstance; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Type; } + + /// Creates an new instance. + public LegacyReservationRecommendation() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__reservationRecommendation), __reservationRecommendation); + await eventListener.AssertObjectIsValid(nameof(__reservationRecommendation), __reservationRecommendation); + } + } + /// Legacy reservation recommendation. + public partial interface ILegacyReservationRecommendation : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation + { + /// The total amount of cost without reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total amount of cost without reserved instances.", + SerializedName = @"costWithNoReservedInstances", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CostWithNoReservedInstance { get; } + /// The usage date for looking back. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The usage date for looking back.", + SerializedName = @"firstUsageDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FirstUsageDate { get; } + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instance Flexibility Group.", + SerializedName = @"instanceFlexibilityGroup", + PossibleTypes = new [] { typeof(string) })] + string InstanceFlexibilityGroup { get; } + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instance Flexibility Ratio.", + SerializedName = @"instanceFlexibilityRatio", + PossibleTypes = new [] { typeof(float) })] + float? InstanceFlexibilityRatio { get; } + /// The number of days of usage to look back for recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The number of days of usage to look back for recommendation.", + SerializedName = @"lookBackPeriod", + PossibleTypes = new [] { typeof(string) })] + string LookBackPeriod { get; } + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter id (GUID)", + SerializedName = @"meterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// Total estimated savings with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total estimated savings with reserved instances.", + SerializedName = @"netSavings", + PossibleTypes = new [] { typeof(decimal) })] + decimal? NetSaving { get; } + /// The normalized Size. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The normalized Size.", + SerializedName = @"normalizedSize", + PossibleTypes = new [] { typeof(string) })] + string NormalizedSize { get; } + /// Recommended quality for reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Recommended quality for reserved instances.", + SerializedName = @"recommendedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? RecommendedQuantity { get; } + /// The recommended Quantity Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The recommended Quantity Normalized.", + SerializedName = @"recommendedQuantityNormalized", + PossibleTypes = new [] { typeof(float) })] + float? RecommendedQuantityNormalized { get; } + /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The azure resource type.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; } + /// Shared or single recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Shared or single recommendation.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// List of sku properties + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of sku properties", + SerializedName = @"skuProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get; } + /// RI recommendations in one or three year terms. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"RI recommendations in one or three year terms.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(string) })] + string Term { get; } + /// The total amount of cost with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total amount of cost with reserved instances.", + SerializedName = @"totalCostWithReservedInstances", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalCostWithReservedInstance { get; } + + } + /// Legacy reservation recommendation. + internal partial interface ILegacyReservationRecommendationInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal + { + /// The total amount of cost without reserved instances. + decimal? CostWithNoReservedInstance { get; set; } + /// The usage date for looking back. + global::System.DateTime? FirstUsageDate { get; set; } + /// The instance Flexibility Group. + string InstanceFlexibilityGroup { get; set; } + /// The instance Flexibility Ratio. + float? InstanceFlexibilityRatio { get; set; } + /// The number of days of usage to look back for recommendation. + string LookBackPeriod { get; set; } + /// The meter id (GUID) + string MeterId { get; set; } + /// Total estimated savings with reserved instances. + decimal? NetSaving { get; set; } + /// The normalized Size. + string NormalizedSize { get; set; } + /// Properties for legacy reservation recommendation + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties Property { get; set; } + /// Recommended quality for reserved instances. + decimal? RecommendedQuantity { get; set; } + /// The recommended Quantity Normalized. + float? RecommendedQuantityNormalized { get; set; } + /// The azure resource type. + string ResourceType { get; set; } + /// Shared or single recommendation. + string Scope { get; set; } + /// List of sku properties + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get; set; } + /// RI recommendations in one or three year terms. + string Term { get; set; } + /// The total amount of cost with reserved instances. + decimal? TotalCostWithReservedInstance { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendation.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendation.json.cs new file mode 100644 index 000000000000..313497969c11 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendation.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Legacy reservation recommendation. + public partial class LegacyReservationRecommendation + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new LegacyReservationRecommendation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal LegacyReservationRecommendation(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __reservationRecommendation = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendation(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendationProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __reservationRecommendation?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendationProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendationProperties.PowerShell.cs new file mode 100644 index 000000000000..5ffcbe1f1206 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendationProperties.PowerShell.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the reservation recommendation. + [System.ComponentModel.TypeConverter(typeof(LegacyReservationRecommendationPropertiesTypeConverter))] + public partial class LegacyReservationRecommendationProperties + { + + /// + /// 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.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LegacyReservationRecommendationProperties(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.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LegacyReservationRecommendationProperties(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.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LegacyReservationRecommendationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).LookBackPeriod = (string) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).LookBackPeriod, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance = (decimal?) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NetSaving = (decimal?) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NetSaving, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LegacyReservationRecommendationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).LookBackPeriod = (string) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).LookBackPeriod, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance = (decimal?) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NetSaving = (decimal?) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NetSaving, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the reservation recommendation. + [System.ComponentModel.TypeConverter(typeof(LegacyReservationRecommendationPropertiesTypeConverter))] + public partial interface ILegacyReservationRecommendationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendationProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendationProperties.TypeConverter.cs new file mode 100644 index 000000000000..da5e78aff9f3 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendationProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LegacyReservationRecommendationPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LegacyReservationRecommendationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LegacyReservationRecommendationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LegacyReservationRecommendationProperties.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/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendationProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendationProperties.cs new file mode 100644 index 000000000000..424ff7e26c8d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendationProperties.cs @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the reservation recommendation. + public partial class LegacyReservationRecommendationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal + { + + /// Backing field for property. + private decimal? _costWithNoReservedInstance; + + /// The total amount of cost without reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? CostWithNoReservedInstance { get => this._costWithNoReservedInstance; } + + /// Backing field for property. + private global::System.DateTime? _firstUsageDate; + + /// The usage date for looking back. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? FirstUsageDate { get => this._firstUsageDate; } + + /// Backing field for property. + private string _instanceFlexibilityGroup; + + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InstanceFlexibilityGroup { get => this._instanceFlexibilityGroup; } + + /// Backing field for property. + private float? _instanceFlexibilityRatio; + + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? InstanceFlexibilityRatio { get => this._instanceFlexibilityRatio; } + + /// Backing field for property. + private string _lookBackPeriod; + + /// The number of days of usage to look back for recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string LookBackPeriod { get => this._lookBackPeriod; } + + /// Backing field for property. + private string _meterId; + + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterId { get => this._meterId; } + + /// Internal Acessors for CostWithNoReservedInstance + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.CostWithNoReservedInstance { get => this._costWithNoReservedInstance; set { {_costWithNoReservedInstance = value;} } } + + /// Internal Acessors for FirstUsageDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.FirstUsageDate { get => this._firstUsageDate; set { {_firstUsageDate = value;} } } + + /// Internal Acessors for InstanceFlexibilityGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.InstanceFlexibilityGroup { get => this._instanceFlexibilityGroup; set { {_instanceFlexibilityGroup = value;} } } + + /// Internal Acessors for InstanceFlexibilityRatio + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.InstanceFlexibilityRatio { get => this._instanceFlexibilityRatio; set { {_instanceFlexibilityRatio = value;} } } + + /// Internal Acessors for LookBackPeriod + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.LookBackPeriod { get => this._lookBackPeriod; set { {_lookBackPeriod = value;} } } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.MeterId { get => this._meterId; set { {_meterId = value;} } } + + /// Internal Acessors for NetSaving + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.NetSaving { get => this._netSaving; set { {_netSaving = value;} } } + + /// Internal Acessors for NormalizedSize + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.NormalizedSize { get => this._normalizedSize; set { {_normalizedSize = value;} } } + + /// Internal Acessors for RecommendedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.RecommendedQuantity { get => this._recommendedQuantity; set { {_recommendedQuantity = value;} } } + + /// Internal Acessors for RecommendedQuantityNormalized + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.RecommendedQuantityNormalized { get => this._recommendedQuantityNormalized; set { {_recommendedQuantityNormalized = value;} } } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.ResourceType { get => this._resourceType; set { {_resourceType = value;} } } + + /// Internal Acessors for SkuProperty + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.SkuProperty { get => this._skuProperty; set { {_skuProperty = value;} } } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.Term { get => this._term; set { {_term = value;} } } + + /// Internal Acessors for TotalCostWithReservedInstance + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.TotalCostWithReservedInstance { get => this._totalCostWithReservedInstance; set { {_totalCostWithReservedInstance = value;} } } + + /// Backing field for property. + private decimal? _netSaving; + + /// Total estimated savings with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? NetSaving { get => this._netSaving; } + + /// Backing field for property. + private string _normalizedSize; + + /// The normalized Size. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NormalizedSize { get => this._normalizedSize; } + + /// Backing field for property. + private decimal? _recommendedQuantity; + + /// Recommended quality for reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? RecommendedQuantity { get => this._recommendedQuantity; } + + /// Backing field for property. + private float? _recommendedQuantityNormalized; + + /// The recommended Quantity Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? RecommendedQuantityNormalized { get => this._recommendedQuantityNormalized; } + + /// Backing field for property. + private string _resourceType; + + /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceType { get => this._resourceType; } + + /// Backing field for property. + private string _scope; + + /// Shared or single recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] _skuProperty; + + /// List of sku properties + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get => this._skuProperty; } + + /// Backing field for property. + private string _term; + + /// RI recommendations in one or three year terms. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Term { get => this._term; } + + /// Backing field for property. + private decimal? _totalCostWithReservedInstance; + + /// The total amount of cost with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? TotalCostWithReservedInstance { get => this._totalCostWithReservedInstance; } + + /// + /// Creates an new instance. + /// + public LegacyReservationRecommendationProperties() + { + + } + } + /// The properties of the reservation recommendation. + public partial interface ILegacyReservationRecommendationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The total amount of cost without reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total amount of cost without reserved instances.", + SerializedName = @"costWithNoReservedInstances", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CostWithNoReservedInstance { get; } + /// The usage date for looking back. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The usage date for looking back.", + SerializedName = @"firstUsageDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FirstUsageDate { get; } + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instance Flexibility Group.", + SerializedName = @"instanceFlexibilityGroup", + PossibleTypes = new [] { typeof(string) })] + string InstanceFlexibilityGroup { get; } + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instance Flexibility Ratio.", + SerializedName = @"instanceFlexibilityRatio", + PossibleTypes = new [] { typeof(float) })] + float? InstanceFlexibilityRatio { get; } + /// The number of days of usage to look back for recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The number of days of usage to look back for recommendation.", + SerializedName = @"lookBackPeriod", + PossibleTypes = new [] { typeof(string) })] + string LookBackPeriod { get; } + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter id (GUID)", + SerializedName = @"meterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// Total estimated savings with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total estimated savings with reserved instances.", + SerializedName = @"netSavings", + PossibleTypes = new [] { typeof(decimal) })] + decimal? NetSaving { get; } + /// The normalized Size. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The normalized Size.", + SerializedName = @"normalizedSize", + PossibleTypes = new [] { typeof(string) })] + string NormalizedSize { get; } + /// Recommended quality for reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Recommended quality for reserved instances.", + SerializedName = @"recommendedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? RecommendedQuantity { get; } + /// The recommended Quantity Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The recommended Quantity Normalized.", + SerializedName = @"recommendedQuantityNormalized", + PossibleTypes = new [] { typeof(float) })] + float? RecommendedQuantityNormalized { get; } + /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The azure resource type.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; } + /// Shared or single recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Shared or single recommendation.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// List of sku properties + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of sku properties", + SerializedName = @"skuProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get; } + /// RI recommendations in one or three year terms. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"RI recommendations in one or three year terms.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(string) })] + string Term { get; } + /// The total amount of cost with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total amount of cost with reserved instances.", + SerializedName = @"totalCostWithReservedInstances", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalCostWithReservedInstance { get; } + + } + /// The properties of the reservation recommendation. + internal partial interface ILegacyReservationRecommendationPropertiesInternal + + { + /// The total amount of cost without reserved instances. + decimal? CostWithNoReservedInstance { get; set; } + /// The usage date for looking back. + global::System.DateTime? FirstUsageDate { get; set; } + /// The instance Flexibility Group. + string InstanceFlexibilityGroup { get; set; } + /// The instance Flexibility Ratio. + float? InstanceFlexibilityRatio { get; set; } + /// The number of days of usage to look back for recommendation. + string LookBackPeriod { get; set; } + /// The meter id (GUID) + string MeterId { get; set; } + /// Total estimated savings with reserved instances. + decimal? NetSaving { get; set; } + /// The normalized Size. + string NormalizedSize { get; set; } + /// Recommended quality for reserved instances. + decimal? RecommendedQuantity { get; set; } + /// The recommended Quantity Normalized. + float? RecommendedQuantityNormalized { get; set; } + /// The azure resource type. + string ResourceType { get; set; } + /// Shared or single recommendation. + string Scope { get; set; } + /// List of sku properties + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get; set; } + /// RI recommendations in one or three year terms. + string Term { get; set; } + /// The total amount of cost with reserved instances. + decimal? TotalCostWithReservedInstance { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendationProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendationProperties.json.cs new file mode 100644 index 000000000000..7d2a2c0d2f54 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationRecommendationProperties.json.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the reservation recommendation. + public partial class LegacyReservationRecommendationProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("scope") ) + { + case "Single": + { + return new LegacySingleScopeReservationRecommendationProperties(json); + } + case "Shared": + { + return new LegacySharedScopeReservationRecommendationProperties(json); + } + } + return new LegacyReservationRecommendationProperties(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal LegacyReservationRecommendationProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_lookBackPeriod = If( json?.PropertyT("lookBackPeriod"), out var __jsonLookBackPeriod) ? (string)__jsonLookBackPeriod : (string)LookBackPeriod;} + {_instanceFlexibilityRatio = If( json?.PropertyT("instanceFlexibilityRatio"), out var __jsonInstanceFlexibilityRatio) ? (float?)__jsonInstanceFlexibilityRatio : InstanceFlexibilityRatio;} + {_instanceFlexibilityGroup = If( json?.PropertyT("instanceFlexibilityGroup"), out var __jsonInstanceFlexibilityGroup) ? (string)__jsonInstanceFlexibilityGroup : (string)InstanceFlexibilityGroup;} + {_normalizedSize = If( json?.PropertyT("normalizedSize"), out var __jsonNormalizedSize) ? (string)__jsonNormalizedSize : (string)NormalizedSize;} + {_recommendedQuantityNormalized = If( json?.PropertyT("recommendedQuantityNormalized"), out var __jsonRecommendedQuantityNormalized) ? (float?)__jsonRecommendedQuantityNormalized : RecommendedQuantityNormalized;} + {_meterId = If( json?.PropertyT("meterId"), out var __jsonMeterId) ? (string)__jsonMeterId : (string)MeterId;} + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)Term;} + {_costWithNoReservedInstance = If( json?.PropertyT("costWithNoReservedInstances"), out var __jsonCostWithNoReservedInstances) ? (decimal?)__jsonCostWithNoReservedInstances : CostWithNoReservedInstance;} + {_recommendedQuantity = If( json?.PropertyT("recommendedQuantity"), out var __jsonRecommendedQuantity) ? (decimal?)__jsonRecommendedQuantity : RecommendedQuantity;} + {_totalCostWithReservedInstance = If( json?.PropertyT("totalCostWithReservedInstances"), out var __jsonTotalCostWithReservedInstances) ? (decimal?)__jsonTotalCostWithReservedInstances : TotalCostWithReservedInstance;} + {_netSaving = If( json?.PropertyT("netSavings"), out var __jsonNetSavings) ? (decimal?)__jsonNetSavings : NetSaving;} + {_firstUsageDate = If( json?.PropertyT("firstUsageDate"), out var __jsonFirstUsageDate) ? global::System.DateTime.TryParse((string)__jsonFirstUsageDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFirstUsageDateValue) ? __jsonFirstUsageDateValue : FirstUsageDate : FirstUsageDate;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_skuProperty = If( json?.PropertyT("skuProperties"), out var __jsonSkuProperties) ? If( __jsonSkuProperties as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ISkuProperty) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuProperty.FromJson(__u) )) ))() : null : SkuProperty;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lookBackPeriod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._lookBackPeriod.ToString()) : null, "lookBackPeriod" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._instanceFlexibilityRatio ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._instanceFlexibilityRatio) : null, "instanceFlexibilityRatio" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._instanceFlexibilityGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._instanceFlexibilityGroup.ToString()) : null, "instanceFlexibilityGroup" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._normalizedSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._normalizedSize.ToString()) : null, "normalizedSize" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._recommendedQuantityNormalized ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._recommendedQuantityNormalized) : null, "recommendedQuantityNormalized" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterId.ToString()) : null, "meterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._term)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._term.ToString()) : null, "term" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._costWithNoReservedInstance ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._costWithNoReservedInstance) : null, "costWithNoReservedInstances" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._recommendedQuantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._recommendedQuantity) : null, "recommendedQuantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalCostWithReservedInstance ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._totalCostWithReservedInstance) : null, "totalCostWithReservedInstances" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._netSaving ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._netSaving) : null, "netSavings" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._firstUsageDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._firstUsageDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "firstUsageDate" ,container.Add ); + } + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._skuProperty) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._skuProperty ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("skuProperties",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransaction.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransaction.PowerShell.cs new file mode 100644 index 000000000000..476eef7ef741 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransaction.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Legacy Reservation transaction resource. + [System.ComponentModel.TypeConverter(typeof(LegacyReservationTransactionTypeConverter))] + public partial class LegacyReservationTransaction + { + + /// + /// 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.Consumption.Models.Api20211001.ILegacyReservationTransaction DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LegacyReservationTransaction(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.Consumption.Models.Api20211001.ILegacyReservationTransaction DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LegacyReservationTransaction(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.Consumption.Models.Api20211001.ILegacyReservationTransaction FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LegacyReservationTransaction(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.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EventDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventDate = (global::System.DateTime?) content.GetValueForProperty("EventDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventType = (string) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventType, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderName, global::System.Convert.ToString); + } + if (content.Contains("PurchasingEnrollment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingEnrollment = (string) content.GetValueForProperty("PurchasingEnrollment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingEnrollment, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionGuid = (string) content.GetValueForProperty("PurchasingSubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionName = (string) content.GetValueForProperty("PurchasingSubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("ArmSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ArmSkuName = (string) content.GetValueForProperty("ArmSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ArmSkuName, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("AccountOwnerEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountOwnerEmail = (string) content.GetValueForProperty("AccountOwnerEmail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountOwnerEmail, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("CurrentEnrollment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CurrentEnrollment = (string) content.GetValueForProperty("CurrentEnrollment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CurrentEnrollment, global::System.Convert.ToString); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingFrequency = (string) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingFrequency, global::System.Convert.ToString); + } + if (content.Contains("BillingMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingMonth = (int?) content.GetValueForProperty("BillingMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).MonetaryCommitment = (decimal?) content.GetValueForProperty("MonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).MonetaryCommitment, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Overage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Overage = (decimal?) content.GetValueForProperty("Overage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Overage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationTransactionPropertiesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LegacyReservationTransaction(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.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EventDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventDate = (global::System.DateTime?) content.GetValueForProperty("EventDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventType = (string) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventType, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderName, global::System.Convert.ToString); + } + if (content.Contains("PurchasingEnrollment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingEnrollment = (string) content.GetValueForProperty("PurchasingEnrollment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingEnrollment, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionGuid = (string) content.GetValueForProperty("PurchasingSubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionName = (string) content.GetValueForProperty("PurchasingSubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("ArmSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ArmSkuName = (string) content.GetValueForProperty("ArmSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ArmSkuName, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("AccountOwnerEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountOwnerEmail = (string) content.GetValueForProperty("AccountOwnerEmail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountOwnerEmail, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("CurrentEnrollment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CurrentEnrollment = (string) content.GetValueForProperty("CurrentEnrollment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CurrentEnrollment, global::System.Convert.ToString); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingFrequency = (string) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingFrequency, global::System.Convert.ToString); + } + if (content.Contains("BillingMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingMonth = (int?) content.GetValueForProperty("BillingMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).MonetaryCommitment = (decimal?) content.GetValueForProperty("MonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).MonetaryCommitment, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Overage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Overage = (decimal?) content.GetValueForProperty("Overage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Overage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationTransactionPropertiesTypeConverter.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Legacy Reservation transaction resource. + [System.ComponentModel.TypeConverter(typeof(LegacyReservationTransactionTypeConverter))] + public partial interface ILegacyReservationTransaction + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransaction.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransaction.TypeConverter.cs new file mode 100644 index 000000000000..035aba878e5a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransaction.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LegacyReservationTransactionTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILegacyReservationTransaction ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransaction).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LegacyReservationTransaction.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LegacyReservationTransaction.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LegacyReservationTransaction.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/consumption/generated/api/Models/Api20211001/LegacyReservationTransaction.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransaction.cs new file mode 100644 index 000000000000..d3fa23f3a7f0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransaction.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Legacy Reservation transaction resource. + public partial class LegacyReservationTransaction : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransaction, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction __reservationTransaction = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransaction(); + + /// The name of the account that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string AccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).AccountName; } + + /// The email of the account owner that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string AccountOwnerEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).AccountOwnerEmail; } + + /// The charge of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? Amount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Amount; } + + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string ArmSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).ArmSkuName; } + + /// The billing frequency, which can be either one-time or recurring. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string BillingFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).BillingFrequency; } + + /// The billing month(yyyyMMdd), on which the event initiated. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public int? BillingMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).BillingMonth; } + + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string CostCenter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).CostCenter; } + + /// The ISO currency in which the transaction is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Currency; } + + /// The current enrollment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string CurrentEnrollment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).CurrentEnrollment; } + + /// The department name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string DepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).DepartmentName; } + + /// The description of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Description; } + + /// The date of the transaction + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public global::System.DateTime? EventDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).EventDate; } + + /// The type of the transaction (Purchase, Cancel or Refund). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string EventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).EventType; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransaction).Id; } + + /// Internal Acessors for AccountName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.AccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).AccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).AccountName = value; } + + /// Internal Acessors for AccountOwnerEmail + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.AccountOwnerEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).AccountOwnerEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).AccountOwnerEmail = value; } + + /// Internal Acessors for Amount + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Amount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Amount = value; } + + /// Internal Acessors for ArmSkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.ArmSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).ArmSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).ArmSkuName = value; } + + /// Internal Acessors for BillingFrequency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.BillingFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).BillingFrequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).BillingFrequency = value; } + + /// Internal Acessors for BillingMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.BillingMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).BillingMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).BillingMonth = value; } + + /// Internal Acessors for CostCenter + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.CostCenter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).CostCenter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).CostCenter = value; } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Currency = value; } + + /// Internal Acessors for CurrentEnrollment + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.CurrentEnrollment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).CurrentEnrollment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).CurrentEnrollment = value; } + + /// Internal Acessors for DepartmentName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.DepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).DepartmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).DepartmentName = value; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Description = value; } + + /// Internal Acessors for EventDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.EventDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).EventDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).EventDate = value; } + + /// Internal Acessors for EventType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.EventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).EventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).EventType = value; } + + /// Internal Acessors for MonetaryCommitment + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.MonetaryCommitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).MonetaryCommitment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).MonetaryCommitment = value; } + + /// Internal Acessors for Overage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Overage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Overage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Overage = value; } + + /// Internal Acessors for PurchasingEnrollment + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.PurchasingEnrollment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).PurchasingEnrollment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).PurchasingEnrollment = value; } + + /// Internal Acessors for PurchasingSubscriptionGuid + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.PurchasingSubscriptionGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).PurchasingSubscriptionGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).PurchasingSubscriptionGuid = value; } + + /// Internal Acessors for PurchasingSubscriptionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.PurchasingSubscriptionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).PurchasingSubscriptionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).PurchasingSubscriptionName = value; } + + /// Internal Acessors for Quantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Quantity = value; } + + /// Internal Acessors for Region + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Region { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Region; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Region = value; } + + /// Internal Acessors for ReservationOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).ReservationOrderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).ReservationOrderId = value; } + + /// Internal Acessors for ReservationOrderName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.ReservationOrderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).ReservationOrderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).ReservationOrderName = value; } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Term = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransaction).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransaction).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransaction).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransaction).Name = value; } + + /// Internal Acessors for Tag + string[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransaction).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransaction).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransaction).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransaction).Type = value; } + + /// The monetary commitment amount at the enrollment scope. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? MonetaryCommitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).MonetaryCommitment; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransaction).Name; } + + /// The overage amount at the enrollment scope. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? Overage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Overage; } + + /// The properties of a legacy reservation transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Property = value ?? null /* model class */; } + + /// The purchasing enrollment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string PurchasingEnrollment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).PurchasingEnrollment; } + + /// The subscription guid that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string PurchasingSubscriptionGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).PurchasingSubscriptionGuid; } + + /// The subscription name that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string PurchasingSubscriptionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).PurchasingSubscriptionName; } + + /// The quantity of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Quantity; } + + /// The region of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Region { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Region; } + + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).ReservationOrderId; } + + /// The name of the reservation order. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string ReservationOrderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).ReservationOrderName; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string[] Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransaction).Tag; } + + /// This is the term of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)__reservationTransaction).Term; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransaction).Type; } + + /// Creates an new instance. + public LegacyReservationTransaction() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__reservationTransaction), __reservationTransaction); + await eventListener.AssertObjectIsValid(nameof(__reservationTransaction), __reservationTransaction); + } + } + /// Legacy Reservation transaction resource. + public partial interface ILegacyReservationTransaction : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction + { + + } + /// Legacy Reservation transaction resource. + internal partial interface ILegacyReservationTransactionInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransaction.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransaction.json.cs new file mode 100644 index 000000000000..a2cd3ccebd13 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransaction.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Legacy Reservation transaction resource. + public partial class LegacyReservationTransaction + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransaction. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransaction. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransaction FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new LegacyReservationTransaction(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal LegacyReservationTransaction(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __reservationTransaction = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransaction(json); + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __reservationTransaction?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransactionProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransactionProperties.PowerShell.cs new file mode 100644 index 000000000000..e82bf45eb73c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransactionProperties.PowerShell.cs @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of a legacy reservation transaction. + [System.ComponentModel.TypeConverter(typeof(LegacyReservationTransactionPropertiesTypeConverter))] + public partial class LegacyReservationTransactionProperties + { + + /// + /// 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.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LegacyReservationTransactionProperties(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.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LegacyReservationTransactionProperties(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.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LegacyReservationTransactionProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EventDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).EventDate = (global::System.DateTime?) content.GetValueForProperty("EventDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).EventDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).EventType = (string) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).EventType, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).ReservationOrderName, global::System.Convert.ToString); + } + if (content.Contains("PurchasingEnrollment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).PurchasingEnrollment = (string) content.GetValueForProperty("PurchasingEnrollment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).PurchasingEnrollment, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).PurchasingSubscriptionGuid = (string) content.GetValueForProperty("PurchasingSubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).PurchasingSubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).PurchasingSubscriptionName = (string) content.GetValueForProperty("PurchasingSubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).PurchasingSubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("ArmSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).ArmSkuName = (string) content.GetValueForProperty("ArmSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).ArmSkuName, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("AccountOwnerEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).AccountOwnerEmail = (string) content.GetValueForProperty("AccountOwnerEmail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).AccountOwnerEmail, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("CurrentEnrollment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).CurrentEnrollment = (string) content.GetValueForProperty("CurrentEnrollment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).CurrentEnrollment, global::System.Convert.ToString); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).BillingFrequency = (string) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).BillingFrequency, global::System.Convert.ToString); + } + if (content.Contains("BillingMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).BillingMonth = (int?) content.GetValueForProperty("BillingMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).BillingMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).MonetaryCommitment = (decimal?) content.GetValueForProperty("MonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).MonetaryCommitment, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Overage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Overage = (decimal?) content.GetValueForProperty("Overage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Overage, (__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 LegacyReservationTransactionProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EventDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).EventDate = (global::System.DateTime?) content.GetValueForProperty("EventDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).EventDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).EventType = (string) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).EventType, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).ReservationOrderName, global::System.Convert.ToString); + } + if (content.Contains("PurchasingEnrollment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).PurchasingEnrollment = (string) content.GetValueForProperty("PurchasingEnrollment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).PurchasingEnrollment, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).PurchasingSubscriptionGuid = (string) content.GetValueForProperty("PurchasingSubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).PurchasingSubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).PurchasingSubscriptionName = (string) content.GetValueForProperty("PurchasingSubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).PurchasingSubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("ArmSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).ArmSkuName = (string) content.GetValueForProperty("ArmSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).ArmSkuName, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("AccountOwnerEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).AccountOwnerEmail = (string) content.GetValueForProperty("AccountOwnerEmail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).AccountOwnerEmail, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("CurrentEnrollment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).CurrentEnrollment = (string) content.GetValueForProperty("CurrentEnrollment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).CurrentEnrollment, global::System.Convert.ToString); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).BillingFrequency = (string) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).BillingFrequency, global::System.Convert.ToString); + } + if (content.Contains("BillingMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).BillingMonth = (int?) content.GetValueForProperty("BillingMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).BillingMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).MonetaryCommitment = (decimal?) content.GetValueForProperty("MonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).MonetaryCommitment, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Overage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Overage = (decimal?) content.GetValueForProperty("Overage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)this).Overage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of a legacy reservation transaction. + [System.ComponentModel.TypeConverter(typeof(LegacyReservationTransactionPropertiesTypeConverter))] + public partial interface ILegacyReservationTransactionProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransactionProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransactionProperties.TypeConverter.cs new file mode 100644 index 000000000000..d1b1b84fb302 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransactionProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LegacyReservationTransactionPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LegacyReservationTransactionProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LegacyReservationTransactionProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LegacyReservationTransactionProperties.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/consumption/generated/api/Models/Api20211001/LegacyReservationTransactionProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransactionProperties.cs new file mode 100644 index 000000000000..55b99283d4e3 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransactionProperties.cs @@ -0,0 +1,518 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of a legacy reservation transaction. + public partial class LegacyReservationTransactionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal + { + + /// Backing field for property. + private string _accountName; + + /// The name of the account that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string AccountName { get => this._accountName; } + + /// Backing field for property. + private string _accountOwnerEmail; + + /// The email of the account owner that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string AccountOwnerEmail { get => this._accountOwnerEmail; } + + /// Backing field for property. + private decimal? _amount; + + /// The charge of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Amount { get => this._amount; } + + /// Backing field for property. + private string _armSkuName; + + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ArmSkuName { get => this._armSkuName; } + + /// Backing field for property. + private string _billingFrequency; + + /// The billing frequency, which can be either one-time or recurring. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingFrequency { get => this._billingFrequency; } + + /// Backing field for property. + private int? _billingMonth; + + /// The billing month(yyyyMMdd), on which the event initiated. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public int? BillingMonth { get => this._billingMonth; } + + /// Backing field for property. + private string _costCenter; + + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CostCenter { get => this._costCenter; } + + /// Backing field for property. + private string _currency; + + /// The ISO currency in which the transaction is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Currency { get => this._currency; } + + /// Backing field for property. + private string _currentEnrollment; + + /// The current enrollment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CurrentEnrollment { get => this._currentEnrollment; } + + /// Backing field for property. + private string _departmentName; + + /// The department name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string DepartmentName { get => this._departmentName; } + + /// Backing field for property. + private string _description; + + /// The description of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Backing field for property. + private global::System.DateTime? _eventDate; + + /// The date of the transaction + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? EventDate { get => this._eventDate; } + + /// Backing field for property. + private string _eventType; + + /// The type of the transaction (Purchase, Cancel or Refund). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string EventType { get => this._eventType; } + + /// Internal Acessors for AccountName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.AccountName { get => this._accountName; set { {_accountName = value;} } } + + /// Internal Acessors for AccountOwnerEmail + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.AccountOwnerEmail { get => this._accountOwnerEmail; set { {_accountOwnerEmail = value;} } } + + /// Internal Acessors for Amount + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.Amount { get => this._amount; set { {_amount = value;} } } + + /// Internal Acessors for ArmSkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.ArmSkuName { get => this._armSkuName; set { {_armSkuName = value;} } } + + /// Internal Acessors for BillingFrequency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.BillingFrequency { get => this._billingFrequency; set { {_billingFrequency = value;} } } + + /// Internal Acessors for BillingMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.BillingMonth { get => this._billingMonth; set { {_billingMonth = value;} } } + + /// Internal Acessors for CostCenter + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.CostCenter { get => this._costCenter; set { {_costCenter = value;} } } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.Currency { get => this._currency; set { {_currency = value;} } } + + /// Internal Acessors for CurrentEnrollment + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.CurrentEnrollment { get => this._currentEnrollment; set { {_currentEnrollment = value;} } } + + /// Internal Acessors for DepartmentName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.DepartmentName { get => this._departmentName; set { {_departmentName = value;} } } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for EventDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.EventDate { get => this._eventDate; set { {_eventDate = value;} } } + + /// Internal Acessors for EventType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.EventType { get => this._eventType; set { {_eventType = value;} } } + + /// Internal Acessors for MonetaryCommitment + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.MonetaryCommitment { get => this._monetaryCommitment; set { {_monetaryCommitment = value;} } } + + /// Internal Acessors for Overage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.Overage { get => this._overage; set { {_overage = value;} } } + + /// Internal Acessors for PurchasingEnrollment + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.PurchasingEnrollment { get => this._purchasingEnrollment; set { {_purchasingEnrollment = value;} } } + + /// Internal Acessors for PurchasingSubscriptionGuid + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.PurchasingSubscriptionGuid { get => this._purchasingSubscriptionGuid; set { {_purchasingSubscriptionGuid = value;} } } + + /// Internal Acessors for PurchasingSubscriptionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.PurchasingSubscriptionName { get => this._purchasingSubscriptionName; set { {_purchasingSubscriptionName = value;} } } + + /// Internal Acessors for Quantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.Quantity { get => this._quantity; set { {_quantity = value;} } } + + /// Internal Acessors for Region + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.Region { get => this._region; set { {_region = value;} } } + + /// Internal Acessors for ReservationOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.ReservationOrderId { get => this._reservationOrderId; set { {_reservationOrderId = value;} } } + + /// Internal Acessors for ReservationOrderName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.ReservationOrderName { get => this._reservationOrderName; set { {_reservationOrderName = value;} } } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal.Term { get => this._term; set { {_term = value;} } } + + /// Backing field for property. + private decimal? _monetaryCommitment; + + /// The monetary commitment amount at the enrollment scope. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? MonetaryCommitment { get => this._monetaryCommitment; } + + /// Backing field for property. + private decimal? _overage; + + /// The overage amount at the enrollment scope. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Overage { get => this._overage; } + + /// Backing field for property. + private string _purchasingEnrollment; + + /// The purchasing enrollment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PurchasingEnrollment { get => this._purchasingEnrollment; } + + /// Backing field for property. + private string _purchasingSubscriptionGuid; + + /// The subscription guid that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PurchasingSubscriptionGuid { get => this._purchasingSubscriptionGuid; } + + /// Backing field for property. + private string _purchasingSubscriptionName; + + /// The subscription name that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PurchasingSubscriptionName { get => this._purchasingSubscriptionName; } + + /// Backing field for property. + private decimal? _quantity; + + /// The quantity of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Quantity { get => this._quantity; } + + /// Backing field for property. + private string _region; + + /// The region of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Region { get => this._region; } + + /// Backing field for property. + private string _reservationOrderId; + + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationOrderId { get => this._reservationOrderId; } + + /// Backing field for property. + private string _reservationOrderName; + + /// The name of the reservation order. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationOrderName { get => this._reservationOrderName; } + + /// Backing field for property. + private string _term; + + /// This is the term of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Term { get => this._term; } + + /// Creates an new instance. + public LegacyReservationTransactionProperties() + { + + } + } + /// The properties of a legacy reservation transaction. + public partial interface ILegacyReservationTransactionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The name of the account that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the account that makes the transaction.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + string AccountName { get; } + /// The email of the account owner that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The email of the account owner that makes the transaction.", + SerializedName = @"accountOwnerEmail", + PossibleTypes = new [] { typeof(string) })] + string AccountOwnerEmail { get; } + /// The charge of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The charge of the transaction.", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Amount { get; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records.", + SerializedName = @"armSkuName", + PossibleTypes = new [] { typeof(string) })] + string ArmSkuName { get; } + /// The billing frequency, which can be either one-time or recurring. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing frequency, which can be either one-time or recurring.", + SerializedName = @"billingFrequency", + PossibleTypes = new [] { typeof(string) })] + string BillingFrequency { get; } + /// The billing month(yyyyMMdd), on which the event initiated. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing month(yyyyMMdd), on which the event initiated.", + SerializedName = @"billingMonth", + PossibleTypes = new [] { typeof(int) })] + int? BillingMonth { get; } + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The cost center of this department if it is a department and a cost center is provided.", + SerializedName = @"costCenter", + PossibleTypes = new [] { typeof(string) })] + string CostCenter { get; } + /// The ISO currency in which the transaction is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ISO currency in which the transaction is charged, for example, USD.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// The current enrollment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current enrollment.", + SerializedName = @"currentEnrollment", + PossibleTypes = new [] { typeof(string) })] + string CurrentEnrollment { get; } + /// The department name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The department name.", + SerializedName = @"departmentName", + PossibleTypes = new [] { typeof(string) })] + string DepartmentName { get; } + /// The description of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The description of the transaction.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// The date of the transaction + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date of the transaction", + SerializedName = @"eventDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EventDate { get; } + /// The type of the transaction (Purchase, Cancel or Refund). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the transaction (Purchase, Cancel or Refund).", + SerializedName = @"eventType", + PossibleTypes = new [] { typeof(string) })] + string EventType { get; } + /// The monetary commitment amount at the enrollment scope. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The monetary commitment amount at the enrollment scope.", + SerializedName = @"monetaryCommitment", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MonetaryCommitment { get; } + /// The overage amount at the enrollment scope. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The overage amount at the enrollment scope.", + SerializedName = @"overage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Overage { get; } + /// The purchasing enrollment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The purchasing enrollment.", + SerializedName = @"purchasingEnrollment", + PossibleTypes = new [] { typeof(string) })] + string PurchasingEnrollment { get; } + /// The subscription guid that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subscription guid that makes the transaction.", + SerializedName = @"purchasingSubscriptionGuid", + PossibleTypes = new [] { typeof(string) })] + string PurchasingSubscriptionGuid { get; } + /// The subscription name that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subscription name that makes the transaction.", + SerializedName = @"purchasingSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + string PurchasingSubscriptionName { get; } + /// The quantity of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The quantity of the transaction.", + SerializedName = @"quantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Quantity { get; } + /// The region of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The region of the transaction.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + string Region { get; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations.", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderId { get; } + /// The name of the reservation order. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the reservation order.", + SerializedName = @"reservationOrderName", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderName { get; } + /// This is the term of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the term of the transaction.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(string) })] + string Term { get; } + + } + /// The properties of a legacy reservation transaction. + internal partial interface ILegacyReservationTransactionPropertiesInternal + + { + /// The name of the account that makes the transaction. + string AccountName { get; set; } + /// The email of the account owner that makes the transaction. + string AccountOwnerEmail { get; set; } + /// The charge of the transaction. + decimal? Amount { get; set; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + string ArmSkuName { get; set; } + /// The billing frequency, which can be either one-time or recurring. + string BillingFrequency { get; set; } + /// The billing month(yyyyMMdd), on which the event initiated. + int? BillingMonth { get; set; } + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + string CostCenter { get; set; } + /// The ISO currency in which the transaction is charged, for example, USD. + string Currency { get; set; } + /// The current enrollment. + string CurrentEnrollment { get; set; } + /// The department name. + string DepartmentName { get; set; } + /// The description of the transaction. + string Description { get; set; } + /// The date of the transaction + global::System.DateTime? EventDate { get; set; } + /// The type of the transaction (Purchase, Cancel or Refund). + string EventType { get; set; } + /// The monetary commitment amount at the enrollment scope. + decimal? MonetaryCommitment { get; set; } + /// The overage amount at the enrollment scope. + decimal? Overage { get; set; } + /// The purchasing enrollment. + string PurchasingEnrollment { get; set; } + /// The subscription guid that makes the transaction. + string PurchasingSubscriptionGuid { get; set; } + /// The subscription name that makes the transaction. + string PurchasingSubscriptionName { get; set; } + /// The quantity of the transaction. + decimal? Quantity { get; set; } + /// The region of the transaction. + string Region { get; set; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + string ReservationOrderId { get; set; } + /// The name of the reservation order. + string ReservationOrderName { get; set; } + /// This is the term of the transaction. + string Term { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransactionProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransactionProperties.json.cs new file mode 100644 index 000000000000..8cfeeee3c9b3 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyReservationTransactionProperties.json.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of a legacy reservation transaction. + public partial class LegacyReservationTransactionProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new LegacyReservationTransactionProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal LegacyReservationTransactionProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_eventDate = If( json?.PropertyT("eventDate"), out var __jsonEventDate) ? global::System.DateTime.TryParse((string)__jsonEventDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEventDateValue) ? __jsonEventDateValue : EventDate : EventDate;} + {_reservationOrderId = If( json?.PropertyT("reservationOrderId"), out var __jsonReservationOrderId) ? (string)__jsonReservationOrderId : (string)ReservationOrderId;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_eventType = If( json?.PropertyT("eventType"), out var __jsonEventType) ? (string)__jsonEventType : (string)EventType;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (decimal?)__jsonQuantity : Quantity;} + {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (decimal?)__jsonAmount : Amount;} + {_currency = If( json?.PropertyT("currency"), out var __jsonCurrency) ? (string)__jsonCurrency : (string)Currency;} + {_reservationOrderName = If( json?.PropertyT("reservationOrderName"), out var __jsonReservationOrderName) ? (string)__jsonReservationOrderName : (string)ReservationOrderName;} + {_purchasingEnrollment = If( json?.PropertyT("purchasingEnrollment"), out var __jsonPurchasingEnrollment) ? (string)__jsonPurchasingEnrollment : (string)PurchasingEnrollment;} + {_purchasingSubscriptionGuid = If( json?.PropertyT("purchasingSubscriptionGuid"), out var __jsonPurchasingSubscriptionGuid) ? (string)__jsonPurchasingSubscriptionGuid : (string)PurchasingSubscriptionGuid;} + {_purchasingSubscriptionName = If( json?.PropertyT("purchasingSubscriptionName"), out var __jsonPurchasingSubscriptionName) ? (string)__jsonPurchasingSubscriptionName : (string)PurchasingSubscriptionName;} + {_armSkuName = If( json?.PropertyT("armSkuName"), out var __jsonArmSkuName) ? (string)__jsonArmSkuName : (string)ArmSkuName;} + {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)Term;} + {_region = If( json?.PropertyT("region"), out var __jsonRegion) ? (string)__jsonRegion : (string)Region;} + {_accountName = If( json?.PropertyT("accountName"), out var __jsonAccountName) ? (string)__jsonAccountName : (string)AccountName;} + {_accountOwnerEmail = If( json?.PropertyT("accountOwnerEmail"), out var __jsonAccountOwnerEmail) ? (string)__jsonAccountOwnerEmail : (string)AccountOwnerEmail;} + {_departmentName = If( json?.PropertyT("departmentName"), out var __jsonDepartmentName) ? (string)__jsonDepartmentName : (string)DepartmentName;} + {_costCenter = If( json?.PropertyT("costCenter"), out var __jsonCostCenter) ? (string)__jsonCostCenter : (string)CostCenter;} + {_currentEnrollment = If( json?.PropertyT("currentEnrollment"), out var __jsonCurrentEnrollment) ? (string)__jsonCurrentEnrollment : (string)CurrentEnrollment;} + {_billingFrequency = If( json?.PropertyT("billingFrequency"), out var __jsonBillingFrequency) ? (string)__jsonBillingFrequency : (string)BillingFrequency;} + {_billingMonth = If( json?.PropertyT("billingMonth"), out var __jsonBillingMonth) ? (int?)__jsonBillingMonth : BillingMonth;} + {_monetaryCommitment = If( json?.PropertyT("monetaryCommitment"), out var __jsonMonetaryCommitment) ? (decimal?)__jsonMonetaryCommitment : MonetaryCommitment;} + {_overage = If( json?.PropertyT("overage"), out var __jsonOverage) ? (decimal?)__jsonOverage : Overage;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._eventDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._eventDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "eventDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationOrderId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationOrderId.ToString()) : null, "reservationOrderId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._eventType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._eventType.ToString()) : null, "eventType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._quantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._quantity) : null, "quantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._amount ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._amount) : null, "amount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._currency.ToString()) : null, "currency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationOrderName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationOrderName.ToString()) : null, "reservationOrderName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._purchasingEnrollment)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._purchasingEnrollment.ToString()) : null, "purchasingEnrollment" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._purchasingSubscriptionGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._purchasingSubscriptionGuid.ToString()) : null, "purchasingSubscriptionGuid" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._purchasingSubscriptionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._purchasingSubscriptionName.ToString()) : null, "purchasingSubscriptionName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._armSkuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._armSkuName.ToString()) : null, "armSkuName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._term)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._term.ToString()) : null, "term" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._region)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._region.ToString()) : null, "region" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._accountName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._accountName.ToString()) : null, "accountName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._accountOwnerEmail)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._accountOwnerEmail.ToString()) : null, "accountOwnerEmail" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._departmentName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._departmentName.ToString()) : null, "departmentName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._costCenter)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._costCenter.ToString()) : null, "costCenter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currentEnrollment)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._currentEnrollment.ToString()) : null, "currentEnrollment" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingFrequency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingFrequency.ToString()) : null, "billingFrequency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._billingMonth ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((int)this._billingMonth) : null, "billingMonth" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._monetaryCommitment ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._monetaryCommitment) : null, "monetaryCommitment" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._overage ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._overage) : null, "overage" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacySharedScopeReservationRecommendationProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySharedScopeReservationRecommendationProperties.PowerShell.cs new file mode 100644 index 000000000000..9c7419ed5842 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySharedScopeReservationRecommendationProperties.PowerShell.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the legacy reservation recommendation for shared scope. + [System.ComponentModel.TypeConverter(typeof(LegacySharedScopeReservationRecommendationPropertiesTypeConverter))] + public partial class LegacySharedScopeReservationRecommendationProperties + { + + /// + /// 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.Consumption.Models.Api20211001.ILegacySharedScopeReservationRecommendationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LegacySharedScopeReservationRecommendationProperties(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.Consumption.Models.Api20211001.ILegacySharedScopeReservationRecommendationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LegacySharedScopeReservationRecommendationProperties(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.Consumption.Models.Api20211001.ILegacySharedScopeReservationRecommendationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LegacySharedScopeReservationRecommendationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).LookBackPeriod = (string) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).LookBackPeriod, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance = (decimal?) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NetSaving = (decimal?) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NetSaving, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LegacySharedScopeReservationRecommendationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).LookBackPeriod = (string) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).LookBackPeriod, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance = (decimal?) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NetSaving = (decimal?) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NetSaving, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the legacy reservation recommendation for shared scope. + [System.ComponentModel.TypeConverter(typeof(LegacySharedScopeReservationRecommendationPropertiesTypeConverter))] + public partial interface ILegacySharedScopeReservationRecommendationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacySharedScopeReservationRecommendationProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySharedScopeReservationRecommendationProperties.TypeConverter.cs new file mode 100644 index 000000000000..0345560af942 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySharedScopeReservationRecommendationProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LegacySharedScopeReservationRecommendationPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILegacySharedScopeReservationRecommendationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySharedScopeReservationRecommendationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LegacySharedScopeReservationRecommendationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LegacySharedScopeReservationRecommendationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LegacySharedScopeReservationRecommendationProperties.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/consumption/generated/api/Models/Api20211001/LegacySharedScopeReservationRecommendationProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySharedScopeReservationRecommendationProperties.cs new file mode 100644 index 000000000000..f7d38e6bf718 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySharedScopeReservationRecommendationProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the legacy reservation recommendation for shared scope. + public partial class LegacySharedScopeReservationRecommendationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySharedScopeReservationRecommendationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySharedScopeReservationRecommendationPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties __legacyReservationRecommendationProperties = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendationProperties(); + + /// The total amount of cost without reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? CostWithNoReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).CostWithNoReservedInstance; } + + /// The usage date for looking back. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public global::System.DateTime? FirstUsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).FirstUsageDate; } + + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).InstanceFlexibilityGroup; } + + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public float? InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).InstanceFlexibilityRatio; } + + /// The number of days of usage to look back for recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string LookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).LookBackPeriod; } + + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).MeterId; } + + /// Internal Acessors for CostWithNoReservedInstance + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.CostWithNoReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).CostWithNoReservedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).CostWithNoReservedInstance = value; } + + /// Internal Acessors for FirstUsageDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.FirstUsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).FirstUsageDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).FirstUsageDate = value; } + + /// Internal Acessors for InstanceFlexibilityGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).InstanceFlexibilityGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).InstanceFlexibilityGroup = value; } + + /// Internal Acessors for InstanceFlexibilityRatio + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).InstanceFlexibilityRatio; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).InstanceFlexibilityRatio = value; } + + /// Internal Acessors for LookBackPeriod + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.LookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).LookBackPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).LookBackPeriod = value; } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).MeterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).MeterId = value; } + + /// Internal Acessors for NetSaving + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.NetSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).NetSaving; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).NetSaving = value; } + + /// Internal Acessors for NormalizedSize + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.NormalizedSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).NormalizedSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).NormalizedSize = value; } + + /// Internal Acessors for RecommendedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.RecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).RecommendedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).RecommendedQuantity = value; } + + /// Internal Acessors for RecommendedQuantityNormalized + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.RecommendedQuantityNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).RecommendedQuantityNormalized; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).RecommendedQuantityNormalized = value; } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).ResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).ResourceType = value; } + + /// Internal Acessors for SkuProperty + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.SkuProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).SkuProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).SkuProperty = value; } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).Term = value; } + + /// Internal Acessors for TotalCostWithReservedInstance + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.TotalCostWithReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).TotalCostWithReservedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).TotalCostWithReservedInstance = value; } + + /// Total estimated savings with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? NetSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).NetSaving; } + + /// The normalized Size. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string NormalizedSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).NormalizedSize; } + + /// Recommended quality for reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? RecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).RecommendedQuantity; } + + /// The recommended Quantity Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public float? RecommendedQuantityNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).RecommendedQuantityNormalized; } + + /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).ResourceType; } + + /// Shared or single recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).Scope = value ; } + + /// List of sku properties + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).SkuProperty; } + + /// RI recommendations in one or three year terms. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).Term; } + + /// The total amount of cost with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? TotalCostWithReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).TotalCostWithReservedInstance; } + + /// + /// Creates an new instance. + /// + public LegacySharedScopeReservationRecommendationProperties() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__legacyReservationRecommendationProperties), __legacyReservationRecommendationProperties); + await eventListener.AssertObjectIsValid(nameof(__legacyReservationRecommendationProperties), __legacyReservationRecommendationProperties); + } + } + /// The properties of the legacy reservation recommendation for shared scope. + public partial interface ILegacySharedScopeReservationRecommendationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties + { + + } + /// The properties of the legacy reservation recommendation for shared scope. + internal partial interface ILegacySharedScopeReservationRecommendationPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacySharedScopeReservationRecommendationProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySharedScopeReservationRecommendationProperties.json.cs new file mode 100644 index 000000000000..75b14f118f3a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySharedScopeReservationRecommendationProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the legacy reservation recommendation for shared scope. + public partial class LegacySharedScopeReservationRecommendationProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySharedScopeReservationRecommendationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySharedScopeReservationRecommendationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySharedScopeReservationRecommendationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new LegacySharedScopeReservationRecommendationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal LegacySharedScopeReservationRecommendationProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __legacyReservationRecommendationProperties = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendationProperties(json); + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __legacyReservationRecommendationProperties?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacySingleScopeReservationRecommendationProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySingleScopeReservationRecommendationProperties.PowerShell.cs new file mode 100644 index 000000000000..d1f9e75ebfc3 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySingleScopeReservationRecommendationProperties.PowerShell.cs @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the legacy reservation recommendation for single scope. + [System.ComponentModel.TypeConverter(typeof(LegacySingleScopeReservationRecommendationPropertiesTypeConverter))] + public partial class LegacySingleScopeReservationRecommendationProperties + { + + /// + /// 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.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LegacySingleScopeReservationRecommendationProperties(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.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LegacySingleScopeReservationRecommendationProperties(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.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LegacySingleScopeReservationRecommendationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationPropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationPropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).LookBackPeriod = (string) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).LookBackPeriod, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance = (decimal?) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NetSaving = (decimal?) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NetSaving, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LegacySingleScopeReservationRecommendationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationPropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationPropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).LookBackPeriod = (string) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).LookBackPeriod, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance = (decimal?) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NetSaving = (decimal?) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).NetSaving, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the legacy reservation recommendation for single scope. + [System.ComponentModel.TypeConverter(typeof(LegacySingleScopeReservationRecommendationPropertiesTypeConverter))] + public partial interface ILegacySingleScopeReservationRecommendationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacySingleScopeReservationRecommendationProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySingleScopeReservationRecommendationProperties.TypeConverter.cs new file mode 100644 index 000000000000..3119800bd050 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySingleScopeReservationRecommendationProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LegacySingleScopeReservationRecommendationPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LegacySingleScopeReservationRecommendationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LegacySingleScopeReservationRecommendationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LegacySingleScopeReservationRecommendationProperties.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/consumption/generated/api/Models/Api20211001/LegacySingleScopeReservationRecommendationProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySingleScopeReservationRecommendationProperties.cs new file mode 100644 index 000000000000..eca976acf873 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySingleScopeReservationRecommendationProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the legacy reservation recommendation for single scope. + public partial class LegacySingleScopeReservationRecommendationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties __legacyReservationRecommendationProperties = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendationProperties(); + + /// The total amount of cost without reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? CostWithNoReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).CostWithNoReservedInstance; } + + /// The usage date for looking back. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public global::System.DateTime? FirstUsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).FirstUsageDate; } + + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).InstanceFlexibilityGroup; } + + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public float? InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).InstanceFlexibilityRatio; } + + /// The number of days of usage to look back for recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string LookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).LookBackPeriod; } + + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).MeterId; } + + /// Internal Acessors for CostWithNoReservedInstance + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.CostWithNoReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).CostWithNoReservedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).CostWithNoReservedInstance = value; } + + /// Internal Acessors for FirstUsageDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.FirstUsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).FirstUsageDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).FirstUsageDate = value; } + + /// Internal Acessors for InstanceFlexibilityGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).InstanceFlexibilityGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).InstanceFlexibilityGroup = value; } + + /// Internal Acessors for InstanceFlexibilityRatio + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).InstanceFlexibilityRatio; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).InstanceFlexibilityRatio = value; } + + /// Internal Acessors for LookBackPeriod + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.LookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).LookBackPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).LookBackPeriod = value; } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).MeterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).MeterId = value; } + + /// Internal Acessors for NetSaving + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.NetSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).NetSaving; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).NetSaving = value; } + + /// Internal Acessors for NormalizedSize + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.NormalizedSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).NormalizedSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).NormalizedSize = value; } + + /// Internal Acessors for RecommendedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.RecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).RecommendedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).RecommendedQuantity = value; } + + /// Internal Acessors for RecommendedQuantityNormalized + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.RecommendedQuantityNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).RecommendedQuantityNormalized; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).RecommendedQuantityNormalized = value; } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).ResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).ResourceType = value; } + + /// Internal Acessors for SkuProperty + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.SkuProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).SkuProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).SkuProperty = value; } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).Term = value; } + + /// Internal Acessors for TotalCostWithReservedInstance + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal.TotalCostWithReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).TotalCostWithReservedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).TotalCostWithReservedInstance = value; } + + /// Internal Acessors for SubscriptionId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationPropertiesInternal.SubscriptionId { get => this._subscriptionId; set { {_subscriptionId = value;} } } + + /// Total estimated savings with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? NetSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).NetSaving; } + + /// The normalized Size. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string NormalizedSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).NormalizedSize; } + + /// Recommended quality for reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? RecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).RecommendedQuantity; } + + /// The recommended Quantity Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public float? RecommendedQuantityNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).RecommendedQuantityNormalized; } + + /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).ResourceType; } + + /// Shared or single recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).Scope = value ; } + + /// List of sku properties + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).SkuProperty; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription id associated with single scoped recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; } + + /// RI recommendations in one or three year terms. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).Term; } + + /// The total amount of cost with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? TotalCostWithReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal)__legacyReservationRecommendationProperties).TotalCostWithReservedInstance; } + + /// + /// Creates an new instance. + /// + public LegacySingleScopeReservationRecommendationProperties() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__legacyReservationRecommendationProperties), __legacyReservationRecommendationProperties); + await eventListener.AssertObjectIsValid(nameof(__legacyReservationRecommendationProperties), __legacyReservationRecommendationProperties); + } + } + /// The properties of the legacy reservation recommendation for single scope. + public partial interface ILegacySingleScopeReservationRecommendationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationProperties + { + /// Subscription id associated with single scoped recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Subscription id associated with single scoped recommendation.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; } + + } + /// The properties of the legacy reservation recommendation for single scope. + internal partial interface ILegacySingleScopeReservationRecommendationPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationRecommendationPropertiesInternal + { + /// Subscription id associated with single scoped recommendation. + string SubscriptionId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacySingleScopeReservationRecommendationProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySingleScopeReservationRecommendationProperties.json.cs new file mode 100644 index 000000000000..8a26e3c0dbd6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacySingleScopeReservationRecommendationProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the legacy reservation recommendation for single scope. + public partial class LegacySingleScopeReservationRecommendationProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacySingleScopeReservationRecommendationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new LegacySingleScopeReservationRecommendationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal LegacySingleScopeReservationRecommendationProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __legacyReservationRecommendationProperties = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationRecommendationProperties(json); + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __legacyReservationRecommendationProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetail.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetail.PowerShell.cs new file mode 100644 index 000000000000..0a933af2c771 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetail.PowerShell.cs @@ -0,0 +1,600 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Legacy usage detail. + [System.ComponentModel.TypeConverter(typeof(LegacyUsageDetailTypeConverter))] + public partial class LegacyUsageDetail + { + + /// + /// 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.Consumption.Models.Api20211001.ILegacyUsageDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LegacyUsageDetail(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.Consumption.Models.Api20211001.ILegacyUsageDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LegacyUsageDetail(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.Consumption.Models.Api20211001.ILegacyUsageDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LegacyUsageDetail(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.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyUsageDetailPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind.CreateFrom); + } + if (content.Contains("MeterDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse) content.GetValueForProperty("MeterDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetail, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsResponseTypeConverter.ConvertFrom); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("BillingAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingAccountName = (string) content.GetValueForProperty("BillingAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingAccountName, global::System.Convert.ToString); + } + if (content.Contains("BillingPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingPeriodStartDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingPeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingPeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingPeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingPeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingProfileName = (string) content.GetValueForProperty("BillingProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingProfileName, global::System.Convert.ToString); + } + if (content.Contains("AccountOwnerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).AccountOwnerId = (string) content.GetValueForProperty("AccountOwnerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).AccountOwnerId, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).SubscriptionName = (string) content.GetValueForProperty("SubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).SubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("Date")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Date = (global::System.DateTime?) content.GetValueForProperty("Date",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Date, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Product")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Product, global::System.Convert.ToString); + } + if (content.Contains("PartNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PartNumber = (string) content.GetValueForProperty("PartNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PartNumber, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EffectivePrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).EffectivePrice = (decimal?) content.GetValueForProperty("EffectivePrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).EffectivePrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Cost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Cost = (decimal?) content.GetValueForProperty("Cost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Cost, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).UnitPrice = (decimal?) content.GetValueForProperty("UnitPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).UnitPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("ConsumedService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ConsumedService = (string) content.GetValueForProperty("ConsumedService",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ConsumedService, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ServiceInfo1 = (string) content.GetValueForProperty("ServiceInfo1",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ServiceInfo1, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ServiceInfo2 = (string) content.GetValueForProperty("ServiceInfo2",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ServiceInfo2, global::System.Convert.ToString); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).InvoiceSection = (string) content.GetValueForProperty("InvoiceSection",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).InvoiceSection, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("ReservationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ReservationName = (string) content.GetValueForProperty("ReservationName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ReservationName, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ProductOrderId = (string) content.GetValueForProperty("ProductOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ProductOrderId, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ProductOrderName = (string) content.GetValueForProperty("ProductOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ProductOrderName, global::System.Convert.ToString); + } + if (content.Contains("OfferId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).OfferId = (string) content.GetValueForProperty("OfferId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).OfferId, global::System.Convert.ToString); + } + if (content.Contains("IsAzureCreditEligible")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).IsAzureCreditEligible = (bool?) content.GetValueForProperty("IsAzureCreditEligible",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).IsAzureCreditEligible, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("PublisherName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PublisherName = (string) content.GetValueForProperty("PublisherName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PublisherName, global::System.Convert.ToString); + } + if (content.Contains("PublisherType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PublisherType = (string) content.GetValueForProperty("PublisherType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PublisherType, global::System.Convert.ToString); + } + if (content.Contains("PlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PlanName, global::System.Convert.ToString); + } + if (content.Contains("ChargeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ChargeType = (string) content.GetValueForProperty("ChargeType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ChargeType, global::System.Convert.ToString); + } + if (content.Contains("Frequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Frequency = (string) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Frequency, global::System.Convert.ToString); + } + if (content.Contains("PayGPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PayGPrice = (decimal?) content.GetValueForProperty("PayGPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PayGPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BenefitId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BenefitId = (string) content.GetValueForProperty("BenefitId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BenefitId, global::System.Convert.ToString); + } + if (content.Contains("BenefitName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BenefitName = (string) content.GetValueForProperty("BenefitName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BenefitName, global::System.Convert.ToString); + } + if (content.Contains("PricingModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PricingModel = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType?) content.GetValueForProperty("PricingModel",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PricingModel, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType.CreateFrom); + } + if (content.Contains("MeterDetailMeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailMeterName = (string) content.GetValueForProperty("MeterDetailMeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailMeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailMeterCategory = (string) content.GetValueForProperty("MeterDetailMeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailMeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailMeterSubCategory = (string) content.GetValueForProperty("MeterDetailMeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailMeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailUnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailUnitOfMeasure = (string) content.GetValueForProperty("MeterDetailUnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailUnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailServiceFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailServiceFamily = (string) content.GetValueForProperty("MeterDetailServiceFamily",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailServiceFamily, 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 LegacyUsageDetail(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.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyUsageDetailPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind.CreateFrom); + } + if (content.Contains("MeterDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse) content.GetValueForProperty("MeterDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetail, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsResponseTypeConverter.ConvertFrom); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("BillingAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingAccountName = (string) content.GetValueForProperty("BillingAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingAccountName, global::System.Convert.ToString); + } + if (content.Contains("BillingPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingPeriodStartDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingPeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingPeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingPeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingPeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingProfileName = (string) content.GetValueForProperty("BillingProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingProfileName, global::System.Convert.ToString); + } + if (content.Contains("AccountOwnerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).AccountOwnerId = (string) content.GetValueForProperty("AccountOwnerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).AccountOwnerId, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).SubscriptionName = (string) content.GetValueForProperty("SubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).SubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("Date")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Date = (global::System.DateTime?) content.GetValueForProperty("Date",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Date, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Product")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Product, global::System.Convert.ToString); + } + if (content.Contains("PartNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PartNumber = (string) content.GetValueForProperty("PartNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PartNumber, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EffectivePrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).EffectivePrice = (decimal?) content.GetValueForProperty("EffectivePrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).EffectivePrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Cost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Cost = (decimal?) content.GetValueForProperty("Cost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Cost, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).UnitPrice = (decimal?) content.GetValueForProperty("UnitPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).UnitPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("ConsumedService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ConsumedService = (string) content.GetValueForProperty("ConsumedService",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ConsumedService, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ServiceInfo1 = (string) content.GetValueForProperty("ServiceInfo1",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ServiceInfo1, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ServiceInfo2 = (string) content.GetValueForProperty("ServiceInfo2",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ServiceInfo2, global::System.Convert.ToString); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).InvoiceSection = (string) content.GetValueForProperty("InvoiceSection",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).InvoiceSection, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("ReservationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ReservationName = (string) content.GetValueForProperty("ReservationName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ReservationName, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ProductOrderId = (string) content.GetValueForProperty("ProductOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ProductOrderId, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ProductOrderName = (string) content.GetValueForProperty("ProductOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ProductOrderName, global::System.Convert.ToString); + } + if (content.Contains("OfferId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).OfferId = (string) content.GetValueForProperty("OfferId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).OfferId, global::System.Convert.ToString); + } + if (content.Contains("IsAzureCreditEligible")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).IsAzureCreditEligible = (bool?) content.GetValueForProperty("IsAzureCreditEligible",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).IsAzureCreditEligible, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("PublisherName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PublisherName = (string) content.GetValueForProperty("PublisherName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PublisherName, global::System.Convert.ToString); + } + if (content.Contains("PublisherType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PublisherType = (string) content.GetValueForProperty("PublisherType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PublisherType, global::System.Convert.ToString); + } + if (content.Contains("PlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PlanName, global::System.Convert.ToString); + } + if (content.Contains("ChargeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ChargeType = (string) content.GetValueForProperty("ChargeType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).ChargeType, global::System.Convert.ToString); + } + if (content.Contains("Frequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Frequency = (string) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).Frequency, global::System.Convert.ToString); + } + if (content.Contains("PayGPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PayGPrice = (decimal?) content.GetValueForProperty("PayGPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PayGPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BenefitId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BenefitId = (string) content.GetValueForProperty("BenefitId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BenefitId, global::System.Convert.ToString); + } + if (content.Contains("BenefitName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BenefitName = (string) content.GetValueForProperty("BenefitName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).BenefitName, global::System.Convert.ToString); + } + if (content.Contains("PricingModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PricingModel = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType?) content.GetValueForProperty("PricingModel",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).PricingModel, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType.CreateFrom); + } + if (content.Contains("MeterDetailMeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailMeterName = (string) content.GetValueForProperty("MeterDetailMeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailMeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailMeterCategory = (string) content.GetValueForProperty("MeterDetailMeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailMeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailMeterSubCategory = (string) content.GetValueForProperty("MeterDetailMeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailMeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailUnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailUnitOfMeasure = (string) content.GetValueForProperty("MeterDetailUnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailUnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailServiceFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailServiceFamily = (string) content.GetValueForProperty("MeterDetailServiceFamily",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal)this).MeterDetailServiceFamily, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Legacy usage detail. + [System.ComponentModel.TypeConverter(typeof(LegacyUsageDetailTypeConverter))] + public partial interface ILegacyUsageDetail + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetail.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetail.TypeConverter.cs new file mode 100644 index 000000000000..668cba21c5d6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetail.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LegacyUsageDetailTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILegacyUsageDetail ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetail).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LegacyUsageDetail.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LegacyUsageDetail.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LegacyUsageDetail.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/consumption/generated/api/Models/Api20211001/LegacyUsageDetail.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetail.cs new file mode 100644 index 000000000000..f63dbf752f49 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetail.cs @@ -0,0 +1,1057 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Legacy usage detail. + public partial class LegacyUsageDetail : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetail, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail __usageDetail = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.UsageDetail(); + + /// Account Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).AccountName; } + + /// Account Owner Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AccountOwnerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).AccountOwnerId; } + + /// + /// Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use this field + /// to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation + /// discount is applied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).AdditionalInfo; } + + /// Unique identifier for the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BenefitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BenefitId; } + + /// Name of the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BenefitName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BenefitName; } + + /// Billing Account identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingAccountId; } + + /// Billing Account Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingAccountName; } + + /// Billing Currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingCurrency; } + + /// The billing period end date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? BillingPeriodEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingPeriodEndDate; } + + /// The billing period start date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? BillingPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingPeriodStartDate; } + + /// Billing Profile identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingProfileId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingProfileId; } + + /// Billing Profile Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingProfileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingProfileName; } + + /// + /// Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ChargeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ChargeType; } + + /// + /// Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided + /// for marketplace usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ConsumedService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ConsumedService; } + + /// The amount of cost before tax. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? Cost { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Cost; } + + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CostCenter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).CostCenter; } + + /// Date for the usage record. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? Date { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Date; } + + /// Effective Price that's charged for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? EffectivePrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).EffectivePrice; } + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Etag; } + + /// + /// Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which + /// recur every month, and UsageBased for charges based on how much a service is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Frequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Frequency; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Id; } + + /// Invoice Section Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InvoiceSection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).InvoiceSection; } + + /// Is Azure Credit Eligible. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public bool? IsAzureCreditEligible { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).IsAzureCreditEligible; } + + /// Specifies the kind of usage details. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)__usageDetail).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)__usageDetail).Kind = value ; } + + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailMeterCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailMeterCategory; } + + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailMeterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailMeterName; } + + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailMeterSubCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailMeterSubCategory; } + + /// The service family. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailServiceFamily { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailServiceFamily; } + + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailUnitOfMeasure { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailUnitOfMeasure; } + + /// + /// The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which + /// the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterId; } + + /// Internal Acessors for AccountName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.AccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).AccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).AccountName = value; } + + /// Internal Acessors for AccountOwnerId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.AccountOwnerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).AccountOwnerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).AccountOwnerId = value; } + + /// Internal Acessors for AdditionalInfo + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).AdditionalInfo = value; } + + /// Internal Acessors for BenefitId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.BenefitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BenefitId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BenefitId = value; } + + /// Internal Acessors for BenefitName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.BenefitName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BenefitName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BenefitName = value; } + + /// Internal Acessors for BillingAccountId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.BillingAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingAccountId = value; } + + /// Internal Acessors for BillingAccountName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.BillingAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingAccountName = value; } + + /// Internal Acessors for BillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.BillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingCurrency = value; } + + /// Internal Acessors for BillingPeriodEndDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.BillingPeriodEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingPeriodEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingPeriodEndDate = value; } + + /// Internal Acessors for BillingPeriodStartDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.BillingPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingPeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingPeriodStartDate = value; } + + /// Internal Acessors for BillingProfileId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.BillingProfileId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingProfileId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingProfileId = value; } + + /// Internal Acessors for BillingProfileName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.BillingProfileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingProfileName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).BillingProfileName = value; } + + /// Internal Acessors for ChargeType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.ChargeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ChargeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ChargeType = value; } + + /// Internal Acessors for ConsumedService + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.ConsumedService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ConsumedService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ConsumedService = value; } + + /// Internal Acessors for Cost + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.Cost { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Cost; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Cost = value; } + + /// Internal Acessors for CostCenter + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.CostCenter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).CostCenter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).CostCenter = value; } + + /// Internal Acessors for Date + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.Date { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Date; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Date = value; } + + /// Internal Acessors for EffectivePrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.EffectivePrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).EffectivePrice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).EffectivePrice = value; } + + /// Internal Acessors for Frequency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.Frequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Frequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Frequency = value; } + + /// Internal Acessors for InvoiceSection + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.InvoiceSection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).InvoiceSection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).InvoiceSection = value; } + + /// Internal Acessors for IsAzureCreditEligible + bool? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.IsAzureCreditEligible { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).IsAzureCreditEligible; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).IsAzureCreditEligible = value; } + + /// Internal Acessors for MeterDetail + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.MeterDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetail = value; } + + /// Internal Acessors for MeterDetailMeterCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.MeterDetailMeterCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailMeterCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailMeterCategory = value; } + + /// Internal Acessors for MeterDetailMeterName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.MeterDetailMeterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailMeterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailMeterName = value; } + + /// Internal Acessors for MeterDetailMeterSubCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.MeterDetailMeterSubCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailMeterSubCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailMeterSubCategory = value; } + + /// Internal Acessors for MeterDetailServiceFamily + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.MeterDetailServiceFamily { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailServiceFamily; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailServiceFamily = value; } + + /// Internal Acessors for MeterDetailUnitOfMeasure + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.MeterDetailUnitOfMeasure { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailUnitOfMeasure; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterDetailUnitOfMeasure = value; } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).MeterId = value; } + + /// Internal Acessors for OfferId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.OfferId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).OfferId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).OfferId = value; } + + /// Internal Acessors for PartNumber + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.PartNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PartNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PartNumber = value; } + + /// Internal Acessors for PayGPrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.PayGPrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PayGPrice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PayGPrice = value; } + + /// Internal Acessors for PlanName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.PlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PlanName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PlanName = value; } + + /// Internal Acessors for PricingModel + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.PricingModel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PricingModel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PricingModel = value; } + + /// Internal Acessors for Product + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.Product { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Product; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Product = value; } + + /// Internal Acessors for ProductOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.ProductOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ProductOrderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ProductOrderId = value; } + + /// Internal Acessors for ProductOrderName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.ProductOrderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ProductOrderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ProductOrderName = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyUsageDetailProperties()); set { {_property = value;} } } + + /// Internal Acessors for PublisherName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.PublisherName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PublisherName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PublisherName = value; } + + /// Internal Acessors for PublisherType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.PublisherType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PublisherType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PublisherType = value; } + + /// Internal Acessors for Quantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Quantity = value; } + + /// Internal Acessors for ReservationId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.ReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ReservationId = value; } + + /// Internal Acessors for ReservationName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.ReservationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ReservationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ReservationName = value; } + + /// Internal Acessors for ResourceGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.ResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ResourceGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ResourceGroup = value; } + + /// Internal Acessors for ResourceId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ResourceId = value; } + + /// Internal Acessors for ResourceLocation + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.ResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ResourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ResourceLocation = value; } + + /// Internal Acessors for ResourceName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.ResourceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ResourceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ResourceName = value; } + + /// Internal Acessors for ServiceInfo1 + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.ServiceInfo1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ServiceInfo1; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ServiceInfo1 = value; } + + /// Internal Acessors for ServiceInfo2 + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.ServiceInfo2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ServiceInfo2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ServiceInfo2 = value; } + + /// Internal Acessors for SubscriptionId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).SubscriptionId = value; } + + /// Internal Acessors for SubscriptionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.SubscriptionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).SubscriptionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).SubscriptionName = value; } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Term = value; } + + /// Internal Acessors for UnitPrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailInternal.UnitPrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).UnitPrice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).UnitPrice = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Name; } + + /// Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string OfferId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).OfferId; } + + /// + /// Part Number of the service used. Can be used to join with the price sheet. Not available for marketplace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PartNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PartNumber; } + + /// Retail price for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? PayGPrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PayGPrice; } + + /// Plan Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PlanName; } + + /// Identifier that indicates how the meter is priced. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? PricingModel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PricingModel; } + + /// + /// Product name for the consumed service or purchase. Not available for Marketplace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Product { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Product; } + + /// Product Order Id. For reservations this is the Reservation Order ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ProductOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ProductOrderId; } + + /// Product Order Name. For reservations this is the SKU that was purchased. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ProductOrderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ProductOrderName; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailProperties _property; + + /// Properties for legacy usage details + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyUsageDetailProperties()); set => this._property = value; } + + /// Publisher Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PublisherName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PublisherName; } + + /// Publisher Type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PublisherType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).PublisherType; } + + /// The usage quantity. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Quantity; } + + /// + /// ARM resource id of the reservation. Only applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ReservationId; } + + /// + /// User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only + /// applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ReservationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ReservationName; } + + /// Resource Group Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ResourceGroup; } + + /// Unique identifier of the Azure Resource Manager usage detail resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ResourceId; } + + /// Resource Location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ResourceLocation; } + + /// Resource Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ResourceName; } + + /// Service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ServiceInfo1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ServiceInfo1; } + + /// Legacy field with optional service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ServiceInfo2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).ServiceInfo2; } + + /// Subscription guid. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).SubscriptionId; } + + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SubscriptionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).SubscriptionName; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Tag; } + + /// + /// Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year reservation. 36 months for a 3 year reservation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).Term; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Type; } + + /// Unit Price is the price applicable to you. (your EA or other contract price). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? UnitPrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)Property).UnitPrice; } + + /// Creates an new instance. + public LegacyUsageDetail() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__usageDetail), __usageDetail); + await eventListener.AssertObjectIsValid(nameof(__usageDetail), __usageDetail); + } + } + /// Legacy usage detail. + public partial interface ILegacyUsageDetail : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail + { + /// Account Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Account Name.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + string AccountName { get; } + /// Account Owner Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Account Owner Id.", + SerializedName = @"accountOwnerId", + PossibleTypes = new [] { typeof(string) })] + string AccountOwnerId { get; } + /// + /// Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use this field + /// to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation + /// discount is applied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use this field to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation discount is applied.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(string) })] + string AdditionalInfo { get; } + /// Unique identifier for the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unique identifier for the applicable benefit.", + SerializedName = @"benefitId", + PossibleTypes = new [] { typeof(string) })] + string BenefitId { get; } + /// Name of the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the applicable benefit.", + SerializedName = @"benefitName", + PossibleTypes = new [] { typeof(string) })] + string BenefitName { get; } + /// Billing Account identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Account identifier.", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + string BillingAccountId { get; } + /// Billing Account Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Account Name.", + SerializedName = @"billingAccountName", + PossibleTypes = new [] { typeof(string) })] + string BillingAccountName { get; } + /// Billing Currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Currency.", + SerializedName = @"billingCurrency", + PossibleTypes = new [] { typeof(string) })] + string BillingCurrency { get; } + /// The billing period end date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing period end date.", + SerializedName = @"billingPeriodEndDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BillingPeriodEndDate { get; } + /// The billing period start date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing period start date.", + SerializedName = @"billingPeriodStartDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BillingPeriodStartDate { get; } + /// Billing Profile identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Profile identifier.", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileId { get; } + /// Billing Profile Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Profile Name.", + SerializedName = @"billingProfileName", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileName { get; } + /// + /// Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund.", + SerializedName = @"chargeType", + PossibleTypes = new [] { typeof(string) })] + string ChargeType { get; } + /// + /// Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided + /// for marketplace usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided for marketplace usage.", + SerializedName = @"consumedService", + PossibleTypes = new [] { typeof(string) })] + string ConsumedService { get; } + /// The amount of cost before tax. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The amount of cost before tax.", + SerializedName = @"cost", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Cost { get; } + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The cost center of this department if it is a department and a cost center is provided.", + SerializedName = @"costCenter", + PossibleTypes = new [] { typeof(string) })] + string CostCenter { get; } + /// Date for the usage record. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date for the usage record.", + SerializedName = @"date", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Date { get; } + /// Effective Price that's charged for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Effective Price that's charged for the usage.", + SerializedName = @"effectivePrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EffectivePrice { get; } + /// + /// Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which + /// recur every month, and UsageBased for charges based on how much a service is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is used.", + SerializedName = @"frequency", + PossibleTypes = new [] { typeof(string) })] + string Frequency { get; } + /// Invoice Section Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice Section Name.", + SerializedName = @"invoiceSection", + PossibleTypes = new [] { typeof(string) })] + string InvoiceSection { get; } + /// Is Azure Credit Eligible. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Is Azure Credit Eligible.", + SerializedName = @"isAzureCreditEligible", + PossibleTypes = new [] { typeof(bool) })] + bool? IsAzureCreditEligible { get; } + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The category of the meter, for example, 'Cloud services', 'Networking', etc..", + SerializedName = @"meterCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailMeterCategory { get; } + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the meter, within the given meter category", + SerializedName = @"meterName", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailMeterName { get; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc..", + SerializedName = @"meterSubCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailMeterSubCategory { get; } + /// The service family. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The service family.", + SerializedName = @"serviceFamily", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailServiceFamily { get; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc.", + SerializedName = @"unitOfMeasure", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailUnitOfMeasure { get; } + /// + /// The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which + /// the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName.", + SerializedName = @"meterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P.", + SerializedName = @"offerId", + PossibleTypes = new [] { typeof(string) })] + string OfferId { get; } + /// + /// Part Number of the service used. Can be used to join with the price sheet. Not available for marketplace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Part Number of the service used. Can be used to join with the price sheet. Not available for marketplace.", + SerializedName = @"partNumber", + PossibleTypes = new [] { typeof(string) })] + string PartNumber { get; } + /// Retail price for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Retail price for the resource.", + SerializedName = @"payGPrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PayGPrice { get; } + /// Plan Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Plan Name.", + SerializedName = @"planName", + PossibleTypes = new [] { typeof(string) })] + string PlanName { get; } + /// Identifier that indicates how the meter is priced. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier that indicates how the meter is priced.", + SerializedName = @"pricingModel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? PricingModel { get; } + /// + /// Product name for the consumed service or purchase. Not available for Marketplace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Product name for the consumed service or purchase. Not available for Marketplace.", + SerializedName = @"product", + PossibleTypes = new [] { typeof(string) })] + string Product { get; } + /// Product Order Id. For reservations this is the Reservation Order ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Product Order Id. For reservations this is the Reservation Order ID.", + SerializedName = @"productOrderId", + PossibleTypes = new [] { typeof(string) })] + string ProductOrderId { get; } + /// Product Order Name. For reservations this is the SKU that was purchased. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Product Order Name. For reservations this is the SKU that was purchased.", + SerializedName = @"productOrderName", + PossibleTypes = new [] { typeof(string) })] + string ProductOrderName { get; } + /// Publisher Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Publisher Name.", + SerializedName = @"publisherName", + PossibleTypes = new [] { typeof(string) })] + string PublisherName { get; } + /// Publisher Type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Publisher Type.", + SerializedName = @"publisherType", + PossibleTypes = new [] { typeof(string) })] + string PublisherType { get; } + /// The usage quantity. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The usage quantity.", + SerializedName = @"quantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Quantity { get; } + /// + /// ARM resource id of the reservation. Only applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ARM resource id of the reservation. Only applies to records relevant to reservations.", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + string ReservationId { get; } + /// + /// User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only + /// applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only applies to records relevant to reservations.", + SerializedName = @"reservationName", + PossibleTypes = new [] { typeof(string) })] + string ReservationName { get; } + /// Resource Group Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Group Name.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; } + /// Unique identifier of the Azure Resource Manager usage detail resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unique identifier of the Azure Resource Manager usage detail resource.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; } + /// Resource Location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Location.", + SerializedName = @"resourceLocation", + PossibleTypes = new [] { typeof(string) })] + string ResourceLocation { get; } + /// Resource Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Name.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + string ResourceName { get; } + /// Service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service-specific metadata.", + SerializedName = @"serviceInfo1", + PossibleTypes = new [] { typeof(string) })] + string ServiceInfo1 { get; } + /// Legacy field with optional service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Legacy field with optional service-specific metadata.", + SerializedName = @"serviceInfo2", + PossibleTypes = new [] { typeof(string) })] + string ServiceInfo2 { get; } + /// Subscription guid. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Subscription guid.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; } + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Subscription name.", + SerializedName = @"subscriptionName", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionName { get; } + /// + /// Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year reservation. 36 months for a 3 year reservation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year reservation. 36 months for a 3 year reservation.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(string) })] + string Term { get; } + /// Unit Price is the price applicable to you. (your EA or other contract price). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unit Price is the price applicable to you. (your EA or other contract price).", + SerializedName = @"unitPrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UnitPrice { get; } + + } + /// Legacy usage detail. + internal partial interface ILegacyUsageDetailInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal + { + /// Account Name. + string AccountName { get; set; } + /// Account Owner Id. + string AccountOwnerId { get; set; } + /// + /// Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use this field + /// to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation + /// discount is applied. + /// + string AdditionalInfo { get; set; } + /// Unique identifier for the applicable benefit. + string BenefitId { get; set; } + /// Name of the applicable benefit. + string BenefitName { get; set; } + /// Billing Account identifier. + string BillingAccountId { get; set; } + /// Billing Account Name. + string BillingAccountName { get; set; } + /// Billing Currency. + string BillingCurrency { get; set; } + /// The billing period end date. + global::System.DateTime? BillingPeriodEndDate { get; set; } + /// The billing period start date. + global::System.DateTime? BillingPeriodStartDate { get; set; } + /// Billing Profile identifier. + string BillingProfileId { get; set; } + /// Billing Profile Name. + string BillingProfileName { get; set; } + /// + /// Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + /// + string ChargeType { get; set; } + /// + /// Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided + /// for marketplace usage. + /// + string ConsumedService { get; set; } + /// The amount of cost before tax. + decimal? Cost { get; set; } + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + string CostCenter { get; set; } + /// Date for the usage record. + global::System.DateTime? Date { get; set; } + /// Effective Price that's charged for the usage. + decimal? EffectivePrice { get; set; } + /// + /// Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which + /// recur every month, and UsageBased for charges based on how much a service is used. + /// + string Frequency { get; set; } + /// Invoice Section Name. + string InvoiceSection { get; set; } + /// Is Azure Credit Eligible. + bool? IsAzureCreditEligible { get; set; } + /// + /// The details about the meter. By default this is not populated, unless it's specified in $expand. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse MeterDetail { get; set; } + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + string MeterDetailMeterCategory { get; set; } + /// The name of the meter, within the given meter category + string MeterDetailMeterName { get; set; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + string MeterDetailMeterSubCategory { get; set; } + /// The service family. + string MeterDetailServiceFamily { get; set; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + string MeterDetailUnitOfMeasure { get; set; } + /// + /// The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which + /// the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + /// + string MeterId { get; set; } + /// Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. + string OfferId { get; set; } + /// + /// Part Number of the service used. Can be used to join with the price sheet. Not available for marketplace. + /// + string PartNumber { get; set; } + /// Retail price for the resource. + decimal? PayGPrice { get; set; } + /// Plan Name. + string PlanName { get; set; } + /// Identifier that indicates how the meter is priced. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? PricingModel { get; set; } + /// + /// Product name for the consumed service or purchase. Not available for Marketplace. + /// + string Product { get; set; } + /// Product Order Id. For reservations this is the Reservation Order ID. + string ProductOrderId { get; set; } + /// Product Order Name. For reservations this is the SKU that was purchased. + string ProductOrderName { get; set; } + /// Properties for legacy usage details + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailProperties Property { get; set; } + /// Publisher Name. + string PublisherName { get; set; } + /// Publisher Type. + string PublisherType { get; set; } + /// The usage quantity. + decimal? Quantity { get; set; } + /// + /// ARM resource id of the reservation. Only applies to records relevant to reservations. + /// + string ReservationId { get; set; } + /// + /// User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only + /// applies to records relevant to reservations. + /// + string ReservationName { get; set; } + /// Resource Group Name. + string ResourceGroup { get; set; } + /// Unique identifier of the Azure Resource Manager usage detail resource. + string ResourceId { get; set; } + /// Resource Location. + string ResourceLocation { get; set; } + /// Resource Name. + string ResourceName { get; set; } + /// Service-specific metadata. + string ServiceInfo1 { get; set; } + /// Legacy field with optional service-specific metadata. + string ServiceInfo2 { get; set; } + /// Subscription guid. + string SubscriptionId { get; set; } + /// Subscription name. + string SubscriptionName { get; set; } + /// + /// Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year reservation. 36 months for a 3 year reservation. + /// + string Term { get; set; } + /// Unit Price is the price applicable to you. (your EA or other contract price). + decimal? UnitPrice { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetail.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetail.json.cs new file mode 100644 index 000000000000..9bcd399380d9 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetail.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Legacy usage detail. + public partial class LegacyUsageDetail + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetail. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new LegacyUsageDetail(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal LegacyUsageDetail(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __usageDetail = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.UsageDetail(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyUsageDetailProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __usageDetail?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/LegacyUsageDetailProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetailProperties.PowerShell.cs new file mode 100644 index 000000000000..e99d6e59264b --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetailProperties.PowerShell.cs @@ -0,0 +1,546 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the legacy usage detail. + [System.ComponentModel.TypeConverter(typeof(LegacyUsageDetailPropertiesTypeConverter))] + public partial class LegacyUsageDetailProperties + { + + /// + /// 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.Consumption.Models.Api20211001.ILegacyUsageDetailProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LegacyUsageDetailProperties(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.Consumption.Models.Api20211001.ILegacyUsageDetailProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LegacyUsageDetailProperties(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.Consumption.Models.Api20211001.ILegacyUsageDetailProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LegacyUsageDetailProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeterDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse) content.GetValueForProperty("MeterDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetail, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsResponseTypeConverter.ConvertFrom); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("BillingAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingAccountName = (string) content.GetValueForProperty("BillingAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingAccountName, global::System.Convert.ToString); + } + if (content.Contains("BillingPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingPeriodStartDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingPeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingPeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingPeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingPeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingProfileName = (string) content.GetValueForProperty("BillingProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingProfileName, global::System.Convert.ToString); + } + if (content.Contains("AccountOwnerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).AccountOwnerId = (string) content.GetValueForProperty("AccountOwnerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).AccountOwnerId, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).SubscriptionName = (string) content.GetValueForProperty("SubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).SubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("Date")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Date = (global::System.DateTime?) content.GetValueForProperty("Date",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Date, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Product")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Product, global::System.Convert.ToString); + } + if (content.Contains("PartNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PartNumber = (string) content.GetValueForProperty("PartNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PartNumber, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EffectivePrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).EffectivePrice = (decimal?) content.GetValueForProperty("EffectivePrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).EffectivePrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Cost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Cost = (decimal?) content.GetValueForProperty("Cost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Cost, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).UnitPrice = (decimal?) content.GetValueForProperty("UnitPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).UnitPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("ConsumedService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ConsumedService = (string) content.GetValueForProperty("ConsumedService",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ConsumedService, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ServiceInfo1 = (string) content.GetValueForProperty("ServiceInfo1",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ServiceInfo1, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ServiceInfo2 = (string) content.GetValueForProperty("ServiceInfo2",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ServiceInfo2, global::System.Convert.ToString); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).InvoiceSection = (string) content.GetValueForProperty("InvoiceSection",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).InvoiceSection, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("ReservationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ReservationName = (string) content.GetValueForProperty("ReservationName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ReservationName, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ProductOrderId = (string) content.GetValueForProperty("ProductOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ProductOrderId, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ProductOrderName = (string) content.GetValueForProperty("ProductOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ProductOrderName, global::System.Convert.ToString); + } + if (content.Contains("OfferId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).OfferId = (string) content.GetValueForProperty("OfferId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).OfferId, global::System.Convert.ToString); + } + if (content.Contains("IsAzureCreditEligible")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).IsAzureCreditEligible = (bool?) content.GetValueForProperty("IsAzureCreditEligible",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).IsAzureCreditEligible, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("PublisherName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PublisherName = (string) content.GetValueForProperty("PublisherName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PublisherName, global::System.Convert.ToString); + } + if (content.Contains("PublisherType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PublisherType = (string) content.GetValueForProperty("PublisherType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PublisherType, global::System.Convert.ToString); + } + if (content.Contains("PlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PlanName, global::System.Convert.ToString); + } + if (content.Contains("ChargeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ChargeType = (string) content.GetValueForProperty("ChargeType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ChargeType, global::System.Convert.ToString); + } + if (content.Contains("Frequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Frequency = (string) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Frequency, global::System.Convert.ToString); + } + if (content.Contains("PayGPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PayGPrice = (decimal?) content.GetValueForProperty("PayGPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PayGPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BenefitId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BenefitId = (string) content.GetValueForProperty("BenefitId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BenefitId, global::System.Convert.ToString); + } + if (content.Contains("BenefitName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BenefitName = (string) content.GetValueForProperty("BenefitName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BenefitName, global::System.Convert.ToString); + } + if (content.Contains("PricingModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PricingModel = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType?) content.GetValueForProperty("PricingModel",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PricingModel, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType.CreateFrom); + } + if (content.Contains("MeterDetailMeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailMeterName = (string) content.GetValueForProperty("MeterDetailMeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailMeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailMeterCategory = (string) content.GetValueForProperty("MeterDetailMeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailMeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailMeterSubCategory = (string) content.GetValueForProperty("MeterDetailMeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailMeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailUnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailUnitOfMeasure = (string) content.GetValueForProperty("MeterDetailUnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailUnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailServiceFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailServiceFamily = (string) content.GetValueForProperty("MeterDetailServiceFamily",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailServiceFamily, 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 LegacyUsageDetailProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeterDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse) content.GetValueForProperty("MeterDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetail, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsResponseTypeConverter.ConvertFrom); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("BillingAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingAccountName = (string) content.GetValueForProperty("BillingAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingAccountName, global::System.Convert.ToString); + } + if (content.Contains("BillingPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingPeriodStartDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingPeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingPeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingPeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingPeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingProfileName = (string) content.GetValueForProperty("BillingProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingProfileName, global::System.Convert.ToString); + } + if (content.Contains("AccountOwnerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).AccountOwnerId = (string) content.GetValueForProperty("AccountOwnerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).AccountOwnerId, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).SubscriptionName = (string) content.GetValueForProperty("SubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).SubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("Date")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Date = (global::System.DateTime?) content.GetValueForProperty("Date",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Date, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Product")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Product, global::System.Convert.ToString); + } + if (content.Contains("PartNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PartNumber = (string) content.GetValueForProperty("PartNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PartNumber, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("EffectivePrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).EffectivePrice = (decimal?) content.GetValueForProperty("EffectivePrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).EffectivePrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Cost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Cost = (decimal?) content.GetValueForProperty("Cost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Cost, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).UnitPrice = (decimal?) content.GetValueForProperty("UnitPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).UnitPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("ConsumedService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ConsumedService = (string) content.GetValueForProperty("ConsumedService",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ConsumedService, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ServiceInfo1 = (string) content.GetValueForProperty("ServiceInfo1",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ServiceInfo1, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ServiceInfo2 = (string) content.GetValueForProperty("ServiceInfo2",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ServiceInfo2, global::System.Convert.ToString); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).InvoiceSection = (string) content.GetValueForProperty("InvoiceSection",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).InvoiceSection, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("ReservationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ReservationName = (string) content.GetValueForProperty("ReservationName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ReservationName, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ProductOrderId = (string) content.GetValueForProperty("ProductOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ProductOrderId, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ProductOrderName = (string) content.GetValueForProperty("ProductOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ProductOrderName, global::System.Convert.ToString); + } + if (content.Contains("OfferId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).OfferId = (string) content.GetValueForProperty("OfferId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).OfferId, global::System.Convert.ToString); + } + if (content.Contains("IsAzureCreditEligible")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).IsAzureCreditEligible = (bool?) content.GetValueForProperty("IsAzureCreditEligible",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).IsAzureCreditEligible, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("PublisherName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PublisherName = (string) content.GetValueForProperty("PublisherName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PublisherName, global::System.Convert.ToString); + } + if (content.Contains("PublisherType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PublisherType = (string) content.GetValueForProperty("PublisherType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PublisherType, global::System.Convert.ToString); + } + if (content.Contains("PlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PlanName, global::System.Convert.ToString); + } + if (content.Contains("ChargeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ChargeType = (string) content.GetValueForProperty("ChargeType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).ChargeType, global::System.Convert.ToString); + } + if (content.Contains("Frequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Frequency = (string) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).Frequency, global::System.Convert.ToString); + } + if (content.Contains("PayGPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PayGPrice = (decimal?) content.GetValueForProperty("PayGPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PayGPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BenefitId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BenefitId = (string) content.GetValueForProperty("BenefitId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BenefitId, global::System.Convert.ToString); + } + if (content.Contains("BenefitName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BenefitName = (string) content.GetValueForProperty("BenefitName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).BenefitName, global::System.Convert.ToString); + } + if (content.Contains("PricingModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PricingModel = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType?) content.GetValueForProperty("PricingModel",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).PricingModel, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType.CreateFrom); + } + if (content.Contains("MeterDetailMeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailMeterName = (string) content.GetValueForProperty("MeterDetailMeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailMeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailMeterCategory = (string) content.GetValueForProperty("MeterDetailMeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailMeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailMeterSubCategory = (string) content.GetValueForProperty("MeterDetailMeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailMeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailUnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailUnitOfMeasure = (string) content.GetValueForProperty("MeterDetailUnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailUnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailServiceFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailServiceFamily = (string) content.GetValueForProperty("MeterDetailServiceFamily",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal)this).MeterDetailServiceFamily, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the legacy usage detail. + [System.ComponentModel.TypeConverter(typeof(LegacyUsageDetailPropertiesTypeConverter))] + public partial interface ILegacyUsageDetailProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetailProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetailProperties.TypeConverter.cs new file mode 100644 index 000000000000..596d725a92d3 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetailProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LegacyUsageDetailPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILegacyUsageDetailProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LegacyUsageDetailProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LegacyUsageDetailProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LegacyUsageDetailProperties.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/consumption/generated/api/Models/Api20211001/LegacyUsageDetailProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetailProperties.cs new file mode 100644 index 000000000000..e8b7e7fdb875 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetailProperties.cs @@ -0,0 +1,1131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the legacy usage detail. + public partial class LegacyUsageDetailProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal + { + + /// Backing field for property. + private string _accountName; + + /// Account Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string AccountName { get => this._accountName; } + + /// Backing field for property. + private string _accountOwnerId; + + /// Account Owner Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string AccountOwnerId { get => this._accountOwnerId; } + + /// Backing field for property. + private string _additionalInfo; + + /// + /// Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use this field + /// to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation + /// discount is applied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string AdditionalInfo { get => this._additionalInfo; } + + /// Backing field for property. + private string _benefitId; + + /// Unique identifier for the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BenefitId { get => this._benefitId; } + + /// Backing field for property. + private string _benefitName; + + /// Name of the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BenefitName { get => this._benefitName; } + + /// Backing field for property. + private string _billingAccountId; + + /// Billing Account identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingAccountId { get => this._billingAccountId; } + + /// Backing field for property. + private string _billingAccountName; + + /// Billing Account Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingAccountName { get => this._billingAccountName; } + + /// Backing field for property. + private string _billingCurrency; + + /// Billing Currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingCurrency { get => this._billingCurrency; } + + /// Backing field for property. + private global::System.DateTime? _billingPeriodEndDate; + + /// The billing period end date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? BillingPeriodEndDate { get => this._billingPeriodEndDate; } + + /// Backing field for property. + private global::System.DateTime? _billingPeriodStartDate; + + /// The billing period start date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? BillingPeriodStartDate { get => this._billingPeriodStartDate; } + + /// Backing field for property. + private string _billingProfileId; + + /// Billing Profile identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingProfileId { get => this._billingProfileId; } + + /// Backing field for property. + private string _billingProfileName; + + /// Billing Profile Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingProfileName { get => this._billingProfileName; } + + /// Backing field for property. + private string _chargeType; + + /// + /// Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ChargeType { get => this._chargeType; } + + /// Backing field for property. + private string _consumedService; + + /// + /// Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided + /// for marketplace usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ConsumedService { get => this._consumedService; } + + /// Backing field for property. + private decimal? _cost; + + /// The amount of cost before tax. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Cost { get => this._cost; } + + /// Backing field for property. + private string _costCenter; + + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CostCenter { get => this._costCenter; } + + /// Backing field for property. + private global::System.DateTime? _date; + + /// Date for the usage record. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? Date { get => this._date; } + + /// Backing field for property. + private decimal? _effectivePrice; + + /// Effective Price that's charged for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? EffectivePrice { get => this._effectivePrice; } + + /// Backing field for property. + private string _frequency; + + /// + /// Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which + /// recur every month, and UsageBased for charges based on how much a service is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Frequency { get => this._frequency; } + + /// Backing field for property. + private string _invoiceSection; + + /// Invoice Section Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InvoiceSection { get => this._invoiceSection; } + + /// Backing field for property. + private bool? _isAzureCreditEligible; + + /// Is Azure Credit Eligible. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public bool? IsAzureCreditEligible { get => this._isAzureCreditEligible; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse _meterDetail; + + /// + /// The details about the meter. By default this is not populated, unless it's specified in $expand. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse MeterDetail { get => (this._meterDetail = this._meterDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsResponse()); } + + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailMeterCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).MeterCategory; } + + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailMeterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).MeterName; } + + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailMeterSubCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).MeterSubCategory; } + + /// The service family. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailServiceFamily { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).ServiceFamily; } + + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailUnitOfMeasure { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).UnitOfMeasure; } + + /// Backing field for property. + private string _meterId; + + /// + /// The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which + /// the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterId { get => this._meterId; } + + /// Internal Acessors for AccountName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.AccountName { get => this._accountName; set { {_accountName = value;} } } + + /// Internal Acessors for AccountOwnerId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.AccountOwnerId { get => this._accountOwnerId; set { {_accountOwnerId = value;} } } + + /// Internal Acessors for AdditionalInfo + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + + /// Internal Acessors for BenefitId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.BenefitId { get => this._benefitId; set { {_benefitId = value;} } } + + /// Internal Acessors for BenefitName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.BenefitName { get => this._benefitName; set { {_benefitName = value;} } } + + /// Internal Acessors for BillingAccountId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.BillingAccountId { get => this._billingAccountId; set { {_billingAccountId = value;} } } + + /// Internal Acessors for BillingAccountName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.BillingAccountName { get => this._billingAccountName; set { {_billingAccountName = value;} } } + + /// Internal Acessors for BillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.BillingCurrency { get => this._billingCurrency; set { {_billingCurrency = value;} } } + + /// Internal Acessors for BillingPeriodEndDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.BillingPeriodEndDate { get => this._billingPeriodEndDate; set { {_billingPeriodEndDate = value;} } } + + /// Internal Acessors for BillingPeriodStartDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.BillingPeriodStartDate { get => this._billingPeriodStartDate; set { {_billingPeriodStartDate = value;} } } + + /// Internal Acessors for BillingProfileId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.BillingProfileId { get => this._billingProfileId; set { {_billingProfileId = value;} } } + + /// Internal Acessors for BillingProfileName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.BillingProfileName { get => this._billingProfileName; set { {_billingProfileName = value;} } } + + /// Internal Acessors for ChargeType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.ChargeType { get => this._chargeType; set { {_chargeType = value;} } } + + /// Internal Acessors for ConsumedService + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.ConsumedService { get => this._consumedService; set { {_consumedService = value;} } } + + /// Internal Acessors for Cost + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.Cost { get => this._cost; set { {_cost = value;} } } + + /// Internal Acessors for CostCenter + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.CostCenter { get => this._costCenter; set { {_costCenter = value;} } } + + /// Internal Acessors for Date + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.Date { get => this._date; set { {_date = value;} } } + + /// Internal Acessors for EffectivePrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.EffectivePrice { get => this._effectivePrice; set { {_effectivePrice = value;} } } + + /// Internal Acessors for Frequency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.Frequency { get => this._frequency; set { {_frequency = value;} } } + + /// Internal Acessors for InvoiceSection + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.InvoiceSection { get => this._invoiceSection; set { {_invoiceSection = value;} } } + + /// Internal Acessors for IsAzureCreditEligible + bool? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.IsAzureCreditEligible { get => this._isAzureCreditEligible; set { {_isAzureCreditEligible = value;} } } + + /// Internal Acessors for MeterDetail + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.MeterDetail { get => (this._meterDetail = this._meterDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsResponse()); set { {_meterDetail = value;} } } + + /// Internal Acessors for MeterDetailMeterCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.MeterDetailMeterCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).MeterCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).MeterCategory = value; } + + /// Internal Acessors for MeterDetailMeterName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.MeterDetailMeterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).MeterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).MeterName = value; } + + /// Internal Acessors for MeterDetailMeterSubCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.MeterDetailMeterSubCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).MeterSubCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).MeterSubCategory = value; } + + /// Internal Acessors for MeterDetailServiceFamily + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.MeterDetailServiceFamily { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).ServiceFamily; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).ServiceFamily = value; } + + /// Internal Acessors for MeterDetailUnitOfMeasure + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.MeterDetailUnitOfMeasure { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).UnitOfMeasure; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)MeterDetail).UnitOfMeasure = value; } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.MeterId { get => this._meterId; set { {_meterId = value;} } } + + /// Internal Acessors for OfferId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.OfferId { get => this._offerId; set { {_offerId = value;} } } + + /// Internal Acessors for PartNumber + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.PartNumber { get => this._partNumber; set { {_partNumber = value;} } } + + /// Internal Acessors for PayGPrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.PayGPrice { get => this._payGPrice; set { {_payGPrice = value;} } } + + /// Internal Acessors for PlanName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.PlanName { get => this._planName; set { {_planName = value;} } } + + /// Internal Acessors for PricingModel + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.PricingModel { get => this._pricingModel; set { {_pricingModel = value;} } } + + /// Internal Acessors for Product + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.Product { get => this._product; set { {_product = value;} } } + + /// Internal Acessors for ProductOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.ProductOrderId { get => this._productOrderId; set { {_productOrderId = value;} } } + + /// Internal Acessors for ProductOrderName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.ProductOrderName { get => this._productOrderName; set { {_productOrderName = value;} } } + + /// Internal Acessors for PublisherName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.PublisherName { get => this._publisherName; set { {_publisherName = value;} } } + + /// Internal Acessors for PublisherType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.PublisherType { get => this._publisherType; set { {_publisherType = value;} } } + + /// Internal Acessors for Quantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.Quantity { get => this._quantity; set { {_quantity = value;} } } + + /// Internal Acessors for ReservationId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.ReservationId { get => this._reservationId; set { {_reservationId = value;} } } + + /// Internal Acessors for ReservationName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.ReservationName { get => this._reservationName; set { {_reservationName = value;} } } + + /// Internal Acessors for ResourceGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.ResourceGroup { get => this._resourceGroup; set { {_resourceGroup = value;} } } + + /// Internal Acessors for ResourceId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.ResourceId { get => this._resourceId; set { {_resourceId = value;} } } + + /// Internal Acessors for ResourceLocation + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.ResourceLocation { get => this._resourceLocation; set { {_resourceLocation = value;} } } + + /// Internal Acessors for ResourceName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.ResourceName { get => this._resourceName; set { {_resourceName = value;} } } + + /// Internal Acessors for ServiceInfo1 + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.ServiceInfo1 { get => this._serviceInfo1; set { {_serviceInfo1 = value;} } } + + /// Internal Acessors for ServiceInfo2 + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.ServiceInfo2 { get => this._serviceInfo2; set { {_serviceInfo2 = value;} } } + + /// Internal Acessors for SubscriptionId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.SubscriptionId { get => this._subscriptionId; set { {_subscriptionId = value;} } } + + /// Internal Acessors for SubscriptionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.SubscriptionName { get => this._subscriptionName; set { {_subscriptionName = value;} } } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.Term { get => this._term; set { {_term = value;} } } + + /// Internal Acessors for UnitPrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailPropertiesInternal.UnitPrice { get => this._unitPrice; set { {_unitPrice = value;} } } + + /// Backing field for property. + private string _offerId; + + /// Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string OfferId { get => this._offerId; } + + /// Backing field for property. + private string _partNumber; + + /// + /// Part Number of the service used. Can be used to join with the price sheet. Not available for marketplace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PartNumber { get => this._partNumber; } + + /// Backing field for property. + private decimal? _payGPrice; + + /// Retail price for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? PayGPrice { get => this._payGPrice; } + + /// Backing field for property. + private string _planName; + + /// Plan Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PlanName { get => this._planName; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? _pricingModel; + + /// Identifier that indicates how the meter is priced. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? PricingModel { get => this._pricingModel; } + + /// Backing field for property. + private string _product; + + /// + /// Product name for the consumed service or purchase. Not available for Marketplace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Product { get => this._product; } + + /// Backing field for property. + private string _productOrderId; + + /// Product Order Id. For reservations this is the Reservation Order ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ProductOrderId { get => this._productOrderId; } + + /// Backing field for property. + private string _productOrderName; + + /// Product Order Name. For reservations this is the SKU that was purchased. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ProductOrderName { get => this._productOrderName; } + + /// Backing field for property. + private string _publisherName; + + /// Publisher Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PublisherName { get => this._publisherName; } + + /// Backing field for property. + private string _publisherType; + + /// Publisher Type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PublisherType { get => this._publisherType; } + + /// Backing field for property. + private decimal? _quantity; + + /// The usage quantity. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Quantity { get => this._quantity; } + + /// Backing field for property. + private string _reservationId; + + /// + /// ARM resource id of the reservation. Only applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationId { get => this._reservationId; } + + /// Backing field for property. + private string _reservationName; + + /// + /// User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only + /// applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationName { get => this._reservationName; } + + /// Backing field for property. + private string _resourceGroup; + + /// Resource Group Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceGroup { get => this._resourceGroup; } + + /// Backing field for property. + private string _resourceId; + + /// Unique identifier of the Azure Resource Manager usage detail resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; } + + /// Backing field for property. + private string _resourceLocation; + + /// Resource Location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceLocation { get => this._resourceLocation; } + + /// Backing field for property. + private string _resourceName; + + /// Resource Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceName { get => this._resourceName; } + + /// Backing field for property. + private string _serviceInfo1; + + /// Service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ServiceInfo1 { get => this._serviceInfo1; } + + /// Backing field for property. + private string _serviceInfo2; + + /// Legacy field with optional service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ServiceInfo2 { get => this._serviceInfo2; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription guid. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; } + + /// Backing field for property. + private string _subscriptionName; + + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SubscriptionName { get => this._subscriptionName; } + + /// Backing field for property. + private string _term; + + /// + /// Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year reservation. 36 months for a 3 year reservation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Term { get => this._term; } + + /// Backing field for property. + private decimal? _unitPrice; + + /// Unit Price is the price applicable to you. (your EA or other contract price). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? UnitPrice { get => this._unitPrice; } + + /// Creates an new instance. + public LegacyUsageDetailProperties() + { + + } + } + /// The properties of the legacy usage detail. + public partial interface ILegacyUsageDetailProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Account Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Account Name.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + string AccountName { get; } + /// Account Owner Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Account Owner Id.", + SerializedName = @"accountOwnerId", + PossibleTypes = new [] { typeof(string) })] + string AccountOwnerId { get; } + /// + /// Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use this field + /// to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation + /// discount is applied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use this field to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation discount is applied.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(string) })] + string AdditionalInfo { get; } + /// Unique identifier for the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unique identifier for the applicable benefit.", + SerializedName = @"benefitId", + PossibleTypes = new [] { typeof(string) })] + string BenefitId { get; } + /// Name of the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the applicable benefit.", + SerializedName = @"benefitName", + PossibleTypes = new [] { typeof(string) })] + string BenefitName { get; } + /// Billing Account identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Account identifier.", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + string BillingAccountId { get; } + /// Billing Account Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Account Name.", + SerializedName = @"billingAccountName", + PossibleTypes = new [] { typeof(string) })] + string BillingAccountName { get; } + /// Billing Currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Currency.", + SerializedName = @"billingCurrency", + PossibleTypes = new [] { typeof(string) })] + string BillingCurrency { get; } + /// The billing period end date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing period end date.", + SerializedName = @"billingPeriodEndDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BillingPeriodEndDate { get; } + /// The billing period start date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing period start date.", + SerializedName = @"billingPeriodStartDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BillingPeriodStartDate { get; } + /// Billing Profile identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Profile identifier.", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileId { get; } + /// Billing Profile Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Profile Name.", + SerializedName = @"billingProfileName", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileName { get; } + /// + /// Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund.", + SerializedName = @"chargeType", + PossibleTypes = new [] { typeof(string) })] + string ChargeType { get; } + /// + /// Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided + /// for marketplace usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided for marketplace usage.", + SerializedName = @"consumedService", + PossibleTypes = new [] { typeof(string) })] + string ConsumedService { get; } + /// The amount of cost before tax. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The amount of cost before tax.", + SerializedName = @"cost", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Cost { get; } + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The cost center of this department if it is a department and a cost center is provided.", + SerializedName = @"costCenter", + PossibleTypes = new [] { typeof(string) })] + string CostCenter { get; } + /// Date for the usage record. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date for the usage record.", + SerializedName = @"date", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Date { get; } + /// Effective Price that's charged for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Effective Price that's charged for the usage.", + SerializedName = @"effectivePrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EffectivePrice { get; } + /// + /// Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which + /// recur every month, and UsageBased for charges based on how much a service is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is used.", + SerializedName = @"frequency", + PossibleTypes = new [] { typeof(string) })] + string Frequency { get; } + /// Invoice Section Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice Section Name.", + SerializedName = @"invoiceSection", + PossibleTypes = new [] { typeof(string) })] + string InvoiceSection { get; } + /// Is Azure Credit Eligible. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Is Azure Credit Eligible.", + SerializedName = @"isAzureCreditEligible", + PossibleTypes = new [] { typeof(bool) })] + bool? IsAzureCreditEligible { get; } + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The category of the meter, for example, 'Cloud services', 'Networking', etc..", + SerializedName = @"meterCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailMeterCategory { get; } + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the meter, within the given meter category", + SerializedName = @"meterName", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailMeterName { get; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc..", + SerializedName = @"meterSubCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailMeterSubCategory { get; } + /// The service family. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The service family.", + SerializedName = @"serviceFamily", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailServiceFamily { get; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc.", + SerializedName = @"unitOfMeasure", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailUnitOfMeasure { get; } + /// + /// The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which + /// the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName.", + SerializedName = @"meterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P.", + SerializedName = @"offerId", + PossibleTypes = new [] { typeof(string) })] + string OfferId { get; } + /// + /// Part Number of the service used. Can be used to join with the price sheet. Not available for marketplace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Part Number of the service used. Can be used to join with the price sheet. Not available for marketplace.", + SerializedName = @"partNumber", + PossibleTypes = new [] { typeof(string) })] + string PartNumber { get; } + /// Retail price for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Retail price for the resource.", + SerializedName = @"payGPrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PayGPrice { get; } + /// Plan Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Plan Name.", + SerializedName = @"planName", + PossibleTypes = new [] { typeof(string) })] + string PlanName { get; } + /// Identifier that indicates how the meter is priced. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier that indicates how the meter is priced.", + SerializedName = @"pricingModel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? PricingModel { get; } + /// + /// Product name for the consumed service or purchase. Not available for Marketplace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Product name for the consumed service or purchase. Not available for Marketplace.", + SerializedName = @"product", + PossibleTypes = new [] { typeof(string) })] + string Product { get; } + /// Product Order Id. For reservations this is the Reservation Order ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Product Order Id. For reservations this is the Reservation Order ID.", + SerializedName = @"productOrderId", + PossibleTypes = new [] { typeof(string) })] + string ProductOrderId { get; } + /// Product Order Name. For reservations this is the SKU that was purchased. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Product Order Name. For reservations this is the SKU that was purchased.", + SerializedName = @"productOrderName", + PossibleTypes = new [] { typeof(string) })] + string ProductOrderName { get; } + /// Publisher Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Publisher Name.", + SerializedName = @"publisherName", + PossibleTypes = new [] { typeof(string) })] + string PublisherName { get; } + /// Publisher Type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Publisher Type.", + SerializedName = @"publisherType", + PossibleTypes = new [] { typeof(string) })] + string PublisherType { get; } + /// The usage quantity. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The usage quantity.", + SerializedName = @"quantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Quantity { get; } + /// + /// ARM resource id of the reservation. Only applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ARM resource id of the reservation. Only applies to records relevant to reservations.", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + string ReservationId { get; } + /// + /// User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only + /// applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only applies to records relevant to reservations.", + SerializedName = @"reservationName", + PossibleTypes = new [] { typeof(string) })] + string ReservationName { get; } + /// Resource Group Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Group Name.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; } + /// Unique identifier of the Azure Resource Manager usage detail resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unique identifier of the Azure Resource Manager usage detail resource.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; } + /// Resource Location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Location.", + SerializedName = @"resourceLocation", + PossibleTypes = new [] { typeof(string) })] + string ResourceLocation { get; } + /// Resource Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Name.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + string ResourceName { get; } + /// Service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service-specific metadata.", + SerializedName = @"serviceInfo1", + PossibleTypes = new [] { typeof(string) })] + string ServiceInfo1 { get; } + /// Legacy field with optional service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Legacy field with optional service-specific metadata.", + SerializedName = @"serviceInfo2", + PossibleTypes = new [] { typeof(string) })] + string ServiceInfo2 { get; } + /// Subscription guid. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Subscription guid.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; } + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Subscription name.", + SerializedName = @"subscriptionName", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionName { get; } + /// + /// Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year reservation. 36 months for a 3 year reservation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year reservation. 36 months for a 3 year reservation.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(string) })] + string Term { get; } + /// Unit Price is the price applicable to you. (your EA or other contract price). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unit Price is the price applicable to you. (your EA or other contract price).", + SerializedName = @"unitPrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UnitPrice { get; } + + } + /// The properties of the legacy usage detail. + internal partial interface ILegacyUsageDetailPropertiesInternal + + { + /// Account Name. + string AccountName { get; set; } + /// Account Owner Id. + string AccountOwnerId { get; set; } + /// + /// Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use this field + /// to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation + /// discount is applied. + /// + string AdditionalInfo { get; set; } + /// Unique identifier for the applicable benefit. + string BenefitId { get; set; } + /// Name of the applicable benefit. + string BenefitName { get; set; } + /// Billing Account identifier. + string BillingAccountId { get; set; } + /// Billing Account Name. + string BillingAccountName { get; set; } + /// Billing Currency. + string BillingCurrency { get; set; } + /// The billing period end date. + global::System.DateTime? BillingPeriodEndDate { get; set; } + /// The billing period start date. + global::System.DateTime? BillingPeriodStartDate { get; set; } + /// Billing Profile identifier. + string BillingProfileId { get; set; } + /// Billing Profile Name. + string BillingProfileName { get; set; } + /// + /// Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + /// + string ChargeType { get; set; } + /// + /// Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided + /// for marketplace usage. + /// + string ConsumedService { get; set; } + /// The amount of cost before tax. + decimal? Cost { get; set; } + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + string CostCenter { get; set; } + /// Date for the usage record. + global::System.DateTime? Date { get; set; } + /// Effective Price that's charged for the usage. + decimal? EffectivePrice { get; set; } + /// + /// Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which + /// recur every month, and UsageBased for charges based on how much a service is used. + /// + string Frequency { get; set; } + /// Invoice Section Name. + string InvoiceSection { get; set; } + /// Is Azure Credit Eligible. + bool? IsAzureCreditEligible { get; set; } + /// + /// The details about the meter. By default this is not populated, unless it's specified in $expand. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse MeterDetail { get; set; } + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + string MeterDetailMeterCategory { get; set; } + /// The name of the meter, within the given meter category + string MeterDetailMeterName { get; set; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + string MeterDetailMeterSubCategory { get; set; } + /// The service family. + string MeterDetailServiceFamily { get; set; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + string MeterDetailUnitOfMeasure { get; set; } + /// + /// The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which + /// the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + /// + string MeterId { get; set; } + /// Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. + string OfferId { get; set; } + /// + /// Part Number of the service used. Can be used to join with the price sheet. Not available for marketplace. + /// + string PartNumber { get; set; } + /// Retail price for the resource. + decimal? PayGPrice { get; set; } + /// Plan Name. + string PlanName { get; set; } + /// Identifier that indicates how the meter is priced. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? PricingModel { get; set; } + /// + /// Product name for the consumed service or purchase. Not available for Marketplace. + /// + string Product { get; set; } + /// Product Order Id. For reservations this is the Reservation Order ID. + string ProductOrderId { get; set; } + /// Product Order Name. For reservations this is the SKU that was purchased. + string ProductOrderName { get; set; } + /// Publisher Name. + string PublisherName { get; set; } + /// Publisher Type. + string PublisherType { get; set; } + /// The usage quantity. + decimal? Quantity { get; set; } + /// + /// ARM resource id of the reservation. Only applies to records relevant to reservations. + /// + string ReservationId { get; set; } + /// + /// User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only + /// applies to records relevant to reservations. + /// + string ReservationName { get; set; } + /// Resource Group Name. + string ResourceGroup { get; set; } + /// Unique identifier of the Azure Resource Manager usage detail resource. + string ResourceId { get; set; } + /// Resource Location. + string ResourceLocation { get; set; } + /// Resource Name. + string ResourceName { get; set; } + /// Service-specific metadata. + string ServiceInfo1 { get; set; } + /// Legacy field with optional service-specific metadata. + string ServiceInfo2 { get; set; } + /// Subscription guid. + string SubscriptionId { get; set; } + /// Subscription name. + string SubscriptionName { get; set; } + /// + /// Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year reservation. 36 months for a 3 year reservation. + /// + string Term { get; set; } + /// Unit Price is the price applicable to you. (your EA or other contract price). + decimal? UnitPrice { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetailProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetailProperties.json.cs new file mode 100644 index 000000000000..97fa64143e08 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LegacyUsageDetailProperties.json.cs @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the legacy usage detail. + public partial class LegacyUsageDetailProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyUsageDetailProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new LegacyUsageDetailProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal LegacyUsageDetailProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_meterDetail = If( json?.PropertyT("meterDetails"), out var __jsonMeterDetails) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsResponse.FromJson(__jsonMeterDetails) : MeterDetail;} + {_billingAccountId = If( json?.PropertyT("billingAccountId"), out var __jsonBillingAccountId) ? (string)__jsonBillingAccountId : (string)BillingAccountId;} + {_billingAccountName = If( json?.PropertyT("billingAccountName"), out var __jsonBillingAccountName) ? (string)__jsonBillingAccountName : (string)BillingAccountName;} + {_billingPeriodStartDate = If( json?.PropertyT("billingPeriodStartDate"), out var __jsonBillingPeriodStartDate) ? global::System.DateTime.TryParse((string)__jsonBillingPeriodStartDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBillingPeriodStartDateValue) ? __jsonBillingPeriodStartDateValue : BillingPeriodStartDate : BillingPeriodStartDate;} + {_billingPeriodEndDate = If( json?.PropertyT("billingPeriodEndDate"), out var __jsonBillingPeriodEndDate) ? global::System.DateTime.TryParse((string)__jsonBillingPeriodEndDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBillingPeriodEndDateValue) ? __jsonBillingPeriodEndDateValue : BillingPeriodEndDate : BillingPeriodEndDate;} + {_billingProfileId = If( json?.PropertyT("billingProfileId"), out var __jsonBillingProfileId) ? (string)__jsonBillingProfileId : (string)BillingProfileId;} + {_billingProfileName = If( json?.PropertyT("billingProfileName"), out var __jsonBillingProfileName) ? (string)__jsonBillingProfileName : (string)BillingProfileName;} + {_accountOwnerId = If( json?.PropertyT("accountOwnerId"), out var __jsonAccountOwnerId) ? (string)__jsonAccountOwnerId : (string)AccountOwnerId;} + {_accountName = If( json?.PropertyT("accountName"), out var __jsonAccountName) ? (string)__jsonAccountName : (string)AccountName;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_subscriptionName = If( json?.PropertyT("subscriptionName"), out var __jsonSubscriptionName) ? (string)__jsonSubscriptionName : (string)SubscriptionName;} + {_date = If( json?.PropertyT("date"), out var __jsonDate) ? global::System.DateTime.TryParse((string)__jsonDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDateValue) ? __jsonDateValue : Date : Date;} + {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? (string)__jsonProduct : (string)Product;} + {_partNumber = If( json?.PropertyT("partNumber"), out var __jsonPartNumber) ? (string)__jsonPartNumber : (string)PartNumber;} + {_meterId = If( json?.PropertyT("meterId"), out var __jsonMeterId) ? (string)__jsonMeterId : (string)MeterId;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (decimal?)__jsonQuantity : Quantity;} + {_effectivePrice = If( json?.PropertyT("effectivePrice"), out var __jsonEffectivePrice) ? (decimal?)__jsonEffectivePrice : EffectivePrice;} + {_cost = If( json?.PropertyT("cost"), out var __jsonCost) ? (decimal?)__jsonCost : Cost;} + {_unitPrice = If( json?.PropertyT("unitPrice"), out var __jsonUnitPrice) ? (decimal?)__jsonUnitPrice : UnitPrice;} + {_billingCurrency = If( json?.PropertyT("billingCurrency"), out var __jsonBillingCurrency) ? (string)__jsonBillingCurrency : (string)BillingCurrency;} + {_resourceLocation = If( json?.PropertyT("resourceLocation"), out var __jsonResourceLocation) ? (string)__jsonResourceLocation : (string)ResourceLocation;} + {_consumedService = If( json?.PropertyT("consumedService"), out var __jsonConsumedService) ? (string)__jsonConsumedService : (string)ConsumedService;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)ResourceName;} + {_serviceInfo1 = If( json?.PropertyT("serviceInfo1"), out var __jsonServiceInfo1) ? (string)__jsonServiceInfo1 : (string)ServiceInfo1;} + {_serviceInfo2 = If( json?.PropertyT("serviceInfo2"), out var __jsonServiceInfo2) ? (string)__jsonServiceInfo2 : (string)ServiceInfo2;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? (string)__jsonAdditionalInfo : (string)AdditionalInfo;} + {_invoiceSection = If( json?.PropertyT("invoiceSection"), out var __jsonInvoiceSection) ? (string)__jsonInvoiceSection : (string)InvoiceSection;} + {_costCenter = If( json?.PropertyT("costCenter"), out var __jsonCostCenter) ? (string)__jsonCostCenter : (string)CostCenter;} + {_resourceGroup = If( json?.PropertyT("resourceGroup"), out var __jsonResourceGroup) ? (string)__jsonResourceGroup : (string)ResourceGroup;} + {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)ReservationId;} + {_reservationName = If( json?.PropertyT("reservationName"), out var __jsonReservationName) ? (string)__jsonReservationName : (string)ReservationName;} + {_productOrderId = If( json?.PropertyT("productOrderId"), out var __jsonProductOrderId) ? (string)__jsonProductOrderId : (string)ProductOrderId;} + {_productOrderName = If( json?.PropertyT("productOrderName"), out var __jsonProductOrderName) ? (string)__jsonProductOrderName : (string)ProductOrderName;} + {_offerId = If( json?.PropertyT("offerId"), out var __jsonOfferId) ? (string)__jsonOfferId : (string)OfferId;} + {_isAzureCreditEligible = If( json?.PropertyT("isAzureCreditEligible"), out var __jsonIsAzureCreditEligible) ? (bool?)__jsonIsAzureCreditEligible : IsAzureCreditEligible;} + {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)Term;} + {_publisherName = If( json?.PropertyT("publisherName"), out var __jsonPublisherName) ? (string)__jsonPublisherName : (string)PublisherName;} + {_publisherType = If( json?.PropertyT("publisherType"), out var __jsonPublisherType) ? (string)__jsonPublisherType : (string)PublisherType;} + {_planName = If( json?.PropertyT("planName"), out var __jsonPlanName) ? (string)__jsonPlanName : (string)PlanName;} + {_chargeType = If( json?.PropertyT("chargeType"), out var __jsonChargeType) ? (string)__jsonChargeType : (string)ChargeType;} + {_frequency = If( json?.PropertyT("frequency"), out var __jsonFrequency) ? (string)__jsonFrequency : (string)Frequency;} + {_payGPrice = If( json?.PropertyT("payGPrice"), out var __jsonPayGPrice) ? (decimal?)__jsonPayGPrice : PayGPrice;} + {_benefitId = If( json?.PropertyT("benefitId"), out var __jsonBenefitId) ? (string)__jsonBenefitId : (string)BenefitId;} + {_benefitName = If( json?.PropertyT("benefitName"), out var __jsonBenefitName) ? (string)__jsonBenefitName : (string)BenefitName;} + {_pricingModel = If( json?.PropertyT("pricingModel"), out var __jsonPricingModel) ? (string)__jsonPricingModel : (string)PricingModel;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._meterDetail ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._meterDetail.ToJson(null,serializationMode) : null, "meterDetails" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingAccountId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingAccountId.ToString()) : null, "billingAccountId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingAccountName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingAccountName.ToString()) : null, "billingAccountName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._billingPeriodStartDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingPeriodStartDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "billingPeriodStartDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._billingPeriodEndDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingPeriodEndDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "billingPeriodEndDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingProfileId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingProfileId.ToString()) : null, "billingProfileId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingProfileName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingProfileName.ToString()) : null, "billingProfileName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._accountOwnerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._accountOwnerId.ToString()) : null, "accountOwnerId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._accountName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._accountName.ToString()) : null, "accountName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._subscriptionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._subscriptionName.ToString()) : null, "subscriptionName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._date ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._date?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "date" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._product)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._product.ToString()) : null, "product" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._partNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._partNumber.ToString()) : null, "partNumber" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterId.ToString()) : null, "meterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._quantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._quantity) : null, "quantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._effectivePrice ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._effectivePrice) : null, "effectivePrice" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cost ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._cost) : null, "cost" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._unitPrice ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._unitPrice) : null, "unitPrice" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingCurrency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingCurrency.ToString()) : null, "billingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceLocation.ToString()) : null, "resourceLocation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._consumedService)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._consumedService.ToString()) : null, "consumedService" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceName.ToString()) : null, "resourceName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serviceInfo1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._serviceInfo1.ToString()) : null, "serviceInfo1" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serviceInfo2)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._serviceInfo2.ToString()) : null, "serviceInfo2" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._additionalInfo)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._additionalInfo.ToString()) : null, "additionalInfo" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._invoiceSection)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._invoiceSection.ToString()) : null, "invoiceSection" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._costCenter)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._costCenter.ToString()) : null, "costCenter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceGroup.ToString()) : null, "resourceGroup" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationId.ToString()) : null, "reservationId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationName.ToString()) : null, "reservationName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._productOrderId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._productOrderId.ToString()) : null, "productOrderId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._productOrderName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._productOrderName.ToString()) : null, "productOrderName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._offerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._offerId.ToString()) : null, "offerId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isAzureCreditEligible ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonBoolean((bool)this._isAzureCreditEligible) : null, "isAzureCreditEligible" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._term)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._term.ToString()) : null, "term" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._publisherName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._publisherName.ToString()) : null, "publisherName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._publisherType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._publisherType.ToString()) : null, "publisherType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._planName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._planName.ToString()) : null, "planName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._chargeType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._chargeType.ToString()) : null, "chargeType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._frequency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._frequency.ToString()) : null, "frequency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._payGPrice ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._payGPrice) : null, "payGPrice" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._benefitId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._benefitId.ToString()) : null, "benefitId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._benefitName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._benefitName.ToString()) : null, "benefitName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._pricingModel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._pricingModel.ToString()) : null, "pricingModel" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LotProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LotProperties.PowerShell.cs new file mode 100644 index 000000000000..29955622bf9e --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LotProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The lot properties. + [System.ComponentModel.TypeConverter(typeof(LotPropertiesTypeConverter))] + public partial class LotProperties + { + + /// + /// 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.Consumption.Models.Api20211001.ILotProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LotProperties(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.Consumption.Models.Api20211001.ILotProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LotProperties(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.Consumption.Models.Api20211001.ILotProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LotProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OriginalAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmount = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("OriginalAmount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmount, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ClosedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ClosedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("OriginalAmountInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("OriginalAmountInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("ClosedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("ClosedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("Reseller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).Reseller = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller) content.GetValueForProperty("Reseller",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).Reseller, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResellerTypeConverter.ConvertFrom); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource.CreateFrom); + } + if (content.Contains("StartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).StartDate = (global::System.DateTime?) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).StartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ExpirationDate = (global::System.DateTime?) content.GetValueForProperty("ExpirationDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ExpirationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PoNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).PoNumber = (string) content.GetValueForProperty("PoNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).PoNumber, global::System.Convert.ToString); + } + if (content.Contains("PurchasedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).PurchasedDate = (global::System.DateTime?) content.GetValueForProperty("PurchasedDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).PurchasedDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status.CreateFrom); + } + if (content.Contains("CreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).CreditCurrency = (string) content.GetValueForProperty("CreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).CreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ResellerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ResellerId = (string) content.GetValueForProperty("ResellerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ResellerId, global::System.Convert.ToString); + } + if (content.Contains("ResellerDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ResellerDescription = (string) content.GetValueForProperty("ResellerDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ResellerDescription, global::System.Convert.ToString); + } + if (content.Contains("OriginalAmountCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountCurrency = (string) content.GetValueForProperty("OriginalAmountCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountCurrency, global::System.Convert.ToString); + } + if (content.Contains("OriginalAmountValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountValue = (decimal?) content.GetValueForProperty("OriginalAmountValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceCurrency = (string) content.GetValueForProperty("ClosedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceValue = (decimal?) content.GetValueForProperty("ClosedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OriginalAmountInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyCurrency = (string) content.GetValueForProperty("OriginalAmountInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("OriginalAmountInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyValue = (decimal?) content.GetValueForProperty("OriginalAmountInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OriginalAmountInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("OriginalAmountInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OriginalAmountInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("OriginalAmountInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyCurrency = (string) content.GetValueForProperty("ClosedBalanceInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth, (__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 LotProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OriginalAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmount = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("OriginalAmount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmount, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ClosedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ClosedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("OriginalAmountInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("OriginalAmountInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("ClosedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("ClosedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("Reseller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).Reseller = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller) content.GetValueForProperty("Reseller",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).Reseller, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResellerTypeConverter.ConvertFrom); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource.CreateFrom); + } + if (content.Contains("StartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).StartDate = (global::System.DateTime?) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).StartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ExpirationDate = (global::System.DateTime?) content.GetValueForProperty("ExpirationDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ExpirationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PoNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).PoNumber = (string) content.GetValueForProperty("PoNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).PoNumber, global::System.Convert.ToString); + } + if (content.Contains("PurchasedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).PurchasedDate = (global::System.DateTime?) content.GetValueForProperty("PurchasedDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).PurchasedDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status.CreateFrom); + } + if (content.Contains("CreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).CreditCurrency = (string) content.GetValueForProperty("CreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).CreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ResellerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ResellerId = (string) content.GetValueForProperty("ResellerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ResellerId, global::System.Convert.ToString); + } + if (content.Contains("ResellerDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ResellerDescription = (string) content.GetValueForProperty("ResellerDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ResellerDescription, global::System.Convert.ToString); + } + if (content.Contains("OriginalAmountCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountCurrency = (string) content.GetValueForProperty("OriginalAmountCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountCurrency, global::System.Convert.ToString); + } + if (content.Contains("OriginalAmountValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountValue = (decimal?) content.GetValueForProperty("OriginalAmountValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceCurrency = (string) content.GetValueForProperty("ClosedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceValue = (decimal?) content.GetValueForProperty("ClosedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OriginalAmountInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyCurrency = (string) content.GetValueForProperty("OriginalAmountInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("OriginalAmountInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyValue = (decimal?) content.GetValueForProperty("OriginalAmountInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OriginalAmountInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("OriginalAmountInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OriginalAmountInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("OriginalAmountInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).OriginalAmountInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyCurrency = (string) content.GetValueForProperty("ClosedBalanceInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth, (__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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The lot properties. + [System.ComponentModel.TypeConverter(typeof(LotPropertiesTypeConverter))] + public partial interface ILotProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LotProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LotProperties.TypeConverter.cs new file mode 100644 index 000000000000..cdd1f7ad0753 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LotProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LotPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILotProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LotProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LotProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LotProperties.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/consumption/generated/api/Models/Api20211001/LotProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LotProperties.cs new file mode 100644 index 000000000000..7586830def0a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LotProperties.cs @@ -0,0 +1,518 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The lot properties. + public partial class LotProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal + { + + /// Backing field for property. + private string _billingCurrency; + + /// The billing currency of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingCurrency { get => this._billingCurrency; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _closedBalance; + + /// The balance as of the last invoice. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount ClosedBalance { get => (this._closedBalance = this._closedBalance ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ClosedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalance).Currency; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate _closedBalanceInBillingCurrency; + + /// The balance as of the last invoice in billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate ClosedBalanceInBillingCurrency { get => (this._closedBalanceInBillingCurrency = this._closedBalanceInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ClosedBalanceInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalanceInBillingCurrency).Currency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ClosedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ClosedBalanceInBillingCurrency).ExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? ClosedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ClosedBalanceInBillingCurrency).ExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ClosedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalanceInBillingCurrency).Value; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ClosedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalance).Value; } + + /// Backing field for property. + private string _creditCurrency; + + /// The currency of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CreditCurrency { get => this._creditCurrency; } + + /// Backing field for property. + private string _eTag; + + /// The eTag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; } + + /// Backing field for property. + private global::System.DateTime? _expirationDate; + + /// The expiration date of a lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? ExpirationDate { get => this._expirationDate; } + + /// Internal Acessors for BillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.BillingCurrency { get => this._billingCurrency; set { {_billingCurrency = value;} } } + + /// Internal Acessors for ClosedBalance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.ClosedBalance { get => (this._closedBalance = this._closedBalance ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_closedBalance = value;} } } + + /// Internal Acessors for ClosedBalanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.ClosedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalance).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalance).Currency = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.ClosedBalanceInBillingCurrency { get => (this._closedBalanceInBillingCurrency = this._closedBalanceInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); set { {_closedBalanceInBillingCurrency = value;} } } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.ClosedBalanceInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalanceInBillingCurrency).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalanceInBillingCurrency).Currency = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.ClosedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ClosedBalanceInBillingCurrency).ExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ClosedBalanceInBillingCurrency).ExchangeRate = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.ClosedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ClosedBalanceInBillingCurrency).ExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)ClosedBalanceInBillingCurrency).ExchangeRateMonth = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.ClosedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalanceInBillingCurrency).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalanceInBillingCurrency).Value = value; } + + /// Internal Acessors for ClosedBalanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.ClosedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalance).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ClosedBalance).Value = value; } + + /// Internal Acessors for CreditCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.CreditCurrency { get => this._creditCurrency; set { {_creditCurrency = value;} } } + + /// Internal Acessors for ETag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.ETag { get => this._eTag; set { {_eTag = value;} } } + + /// Internal Acessors for ExpirationDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.ExpirationDate { get => this._expirationDate; set { {_expirationDate = value;} } } + + /// Internal Acessors for OriginalAmount + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.OriginalAmount { get => (this._originalAmount = this._originalAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_originalAmount = value;} } } + + /// Internal Acessors for OriginalAmountCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.OriginalAmountCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)OriginalAmount).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)OriginalAmount).Currency = value; } + + /// Internal Acessors for OriginalAmountInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.OriginalAmountInBillingCurrency { get => (this._originalAmountInBillingCurrency = this._originalAmountInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); set { {_originalAmountInBillingCurrency = value;} } } + + /// Internal Acessors for OriginalAmountInBillingCurrencyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.OriginalAmountInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)OriginalAmountInBillingCurrency).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)OriginalAmountInBillingCurrency).Currency = value; } + + /// Internal Acessors for OriginalAmountInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.OriginalAmountInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)OriginalAmountInBillingCurrency).ExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)OriginalAmountInBillingCurrency).ExchangeRate = value; } + + /// Internal Acessors for OriginalAmountInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.OriginalAmountInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)OriginalAmountInBillingCurrency).ExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)OriginalAmountInBillingCurrency).ExchangeRateMonth = value; } + + /// Internal Acessors for OriginalAmountInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.OriginalAmountInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)OriginalAmountInBillingCurrency).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)OriginalAmountInBillingCurrency).Value = value; } + + /// Internal Acessors for OriginalAmountValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.OriginalAmountValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)OriginalAmount).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)OriginalAmount).Value = value; } + + /// Internal Acessors for PoNumber + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.PoNumber { get => this._poNumber; set { {_poNumber = value;} } } + + /// Internal Acessors for PurchasedDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.PurchasedDate { get => this._purchasedDate; set { {_purchasedDate = value;} } } + + /// Internal Acessors for Reseller + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.Reseller { get => (this._reseller = this._reseller ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Reseller()); set { {_reseller = value;} } } + + /// Internal Acessors for ResellerDescription + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.ResellerDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Description = value; } + + /// Internal Acessors for ResellerId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.ResellerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Id = value; } + + /// Internal Acessors for Source + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.Source { get => this._source; set { {_source = value;} } } + + /// Internal Acessors for StartDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.StartDate { get => this._startDate; set { {_startDate = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal.Status { get => this._status; set { {_status = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _originalAmount; + + /// The original amount of a lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount OriginalAmount { get => (this._originalAmount = this._originalAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string OriginalAmountCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)OriginalAmount).Currency; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate _originalAmountInBillingCurrency; + + /// The original amount of a lot in billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate OriginalAmountInBillingCurrency { get => (this._originalAmountInBillingCurrency = this._originalAmountInBillingCurrency ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string OriginalAmountInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)OriginalAmountInBillingCurrency).Currency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? OriginalAmountInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)OriginalAmountInBillingCurrency).ExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? OriginalAmountInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRateInternal)OriginalAmountInBillingCurrency).ExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? OriginalAmountInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)OriginalAmountInBillingCurrency).Value; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? OriginalAmountValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)OriginalAmount).Value; } + + /// Backing field for property. + private string _poNumber; + + /// + /// The po number of the invoice on which the lot was added. This property is not available for ConsumptionCommitment lots. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PoNumber { get => this._poNumber; } + + /// Backing field for property. + private global::System.DateTime? _purchasedDate; + + /// The date when the lot was added. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? PurchasedDate { get => this._purchasedDate; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller _reseller; + + /// The reseller of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Reseller { get => (this._reseller = this._reseller ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Reseller()); } + + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Description; } + + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)Reseller).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource? _source; + + /// The source of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource? Source { get => this._source; } + + /// Backing field for property. + private global::System.DateTime? _startDate; + + /// The date when the lot became effective. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? StartDate { get => this._startDate; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status? _status; + + /// The status of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status? Status { get => this._status; } + + /// Creates an new instance. + public LotProperties() + { + + } + } + /// The lot properties. + public partial interface ILotProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The billing currency of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing currency of the lot.", + SerializedName = @"billingCurrency", + PossibleTypes = new [] { typeof(string) })] + string BillingCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ClosedBalanceCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ClosedBalanceInBillingCurrencyCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ClosedBalanceInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? ClosedBalanceInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ClosedBalanceInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ClosedBalanceValue { get; } + /// The currency of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The currency of the lot.", + SerializedName = @"creditCurrency", + PossibleTypes = new [] { typeof(string) })] + string CreditCurrency { get; } + /// The eTag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The eTag for the resource.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; } + /// The expiration date of a lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The expiration date of a lot.", + SerializedName = @"expirationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationDate { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string OriginalAmountCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string OriginalAmountInBillingCurrencyCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? OriginalAmountInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? OriginalAmountInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? OriginalAmountInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? OriginalAmountValue { get; } + /// + /// The po number of the invoice on which the lot was added. This property is not available for ConsumptionCommitment lots. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The po number of the invoice on which the lot was added. This property is not available for ConsumptionCommitment lots.", + SerializedName = @"poNumber", + PossibleTypes = new [] { typeof(string) })] + string PoNumber { get; } + /// The date when the lot was added. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date when the lot was added.", + SerializedName = @"purchasedDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PurchasedDate { get; } + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property description.", + SerializedName = @"resellerDescription", + PossibleTypes = new [] { typeof(string) })] + string ResellerDescription { get; } + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property ID.", + SerializedName = @"resellerId", + PossibleTypes = new [] { typeof(string) })] + string ResellerId { get; } + /// The source of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The source of the lot.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource? Source { get; } + /// The date when the lot became effective. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date when the lot became effective.", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartDate { get; } + /// The status of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The status of the lot.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status? Status { get; } + + } + /// The lot properties. + internal partial interface ILotPropertiesInternal + + { + /// The billing currency of the lot. + string BillingCurrency { get; set; } + /// The balance as of the last invoice. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount ClosedBalance { get; set; } + /// Amount currency. + string ClosedBalanceCurrency { get; set; } + /// The balance as of the last invoice in billing currency. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate ClosedBalanceInBillingCurrency { get; set; } + /// Amount currency. + string ClosedBalanceInBillingCurrencyCurrency { get; set; } + /// The exchange rate. + decimal? ClosedBalanceInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? ClosedBalanceInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? ClosedBalanceInBillingCurrencyValue { get; set; } + /// Amount. + decimal? ClosedBalanceValue { get; set; } + /// The currency of the lot. + string CreditCurrency { get; set; } + /// The eTag for the resource. + string ETag { get; set; } + /// The expiration date of a lot. + global::System.DateTime? ExpirationDate { get; set; } + /// The original amount of a lot. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount OriginalAmount { get; set; } + /// Amount currency. + string OriginalAmountCurrency { get; set; } + /// The original amount of a lot in billing currency. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate OriginalAmountInBillingCurrency { get; set; } + /// Amount currency. + string OriginalAmountInBillingCurrencyCurrency { get; set; } + /// The exchange rate. + decimal? OriginalAmountInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? OriginalAmountInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? OriginalAmountInBillingCurrencyValue { get; set; } + /// Amount. + decimal? OriginalAmountValue { get; set; } + /// + /// The po number of the invoice on which the lot was added. This property is not available for ConsumptionCommitment lots. + /// + string PoNumber { get; set; } + /// The date when the lot was added. + global::System.DateTime? PurchasedDate { get; set; } + /// The reseller of the lot. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Reseller { get; set; } + /// The reseller property description. + string ResellerDescription { get; set; } + /// The reseller property ID. + string ResellerId { get; set; } + /// The source of the lot. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource? Source { get; set; } + /// The date when the lot became effective. + global::System.DateTime? StartDate { get; set; } + /// The status of the lot. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LotProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LotProperties.json.cs new file mode 100644 index 000000000000..8335a3fd3ef8 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LotProperties.json.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The lot properties. + public partial class LotProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new LotProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal LotProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_originalAmount = If( json?.PropertyT("originalAmount"), out var __jsonOriginalAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonOriginalAmount) : OriginalAmount;} + {_closedBalance = If( json?.PropertyT("closedBalance"), out var __jsonClosedBalance) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonClosedBalance) : ClosedBalance;} + {_originalAmountInBillingCurrency = If( json?.PropertyT("originalAmountInBillingCurrency"), out var __jsonOriginalAmountInBillingCurrency) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate.FromJson(__jsonOriginalAmountInBillingCurrency) : OriginalAmountInBillingCurrency;} + {_closedBalanceInBillingCurrency = If( json?.PropertyT("closedBalanceInBillingCurrency"), out var __jsonClosedBalanceInBillingCurrency) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRate.FromJson(__jsonClosedBalanceInBillingCurrency) : ClosedBalanceInBillingCurrency;} + {_reseller = If( json?.PropertyT("reseller"), out var __jsonReseller) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Reseller.FromJson(__jsonReseller) : Reseller;} + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? (string)__jsonSource : (string)Source;} + {_startDate = If( json?.PropertyT("startDate"), out var __jsonStartDate) ? global::System.DateTime.TryParse((string)__jsonStartDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateValue) ? __jsonStartDateValue : StartDate : StartDate;} + {_expirationDate = If( json?.PropertyT("expirationDate"), out var __jsonExpirationDate) ? global::System.DateTime.TryParse((string)__jsonExpirationDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationDateValue) ? __jsonExpirationDateValue : ExpirationDate : ExpirationDate;} + {_poNumber = If( json?.PropertyT("poNumber"), out var __jsonPoNumber) ? (string)__jsonPoNumber : (string)PoNumber;} + {_purchasedDate = If( json?.PropertyT("purchasedDate"), out var __jsonPurchasedDate) ? global::System.DateTime.TryParse((string)__jsonPurchasedDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonPurchasedDateValue) ? __jsonPurchasedDateValue : PurchasedDate : PurchasedDate;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_creditCurrency = If( json?.PropertyT("creditCurrency"), out var __jsonCreditCurrency) ? (string)__jsonCreditCurrency : (string)CreditCurrency;} + {_billingCurrency = If( json?.PropertyT("billingCurrency"), out var __jsonBillingCurrency) ? (string)__jsonBillingCurrency : (string)BillingCurrency;} + {_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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._originalAmount ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._originalAmount.ToJson(null,serializationMode) : null, "originalAmount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._closedBalance ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._closedBalance.ToJson(null,serializationMode) : null, "closedBalance" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._originalAmountInBillingCurrency ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._originalAmountInBillingCurrency.ToJson(null,serializationMode) : null, "originalAmountInBillingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._closedBalanceInBillingCurrency ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._closedBalanceInBillingCurrency.ToJson(null,serializationMode) : null, "closedBalanceInBillingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._reseller ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._reseller.ToJson(null,serializationMode) : null, "reseller" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._source)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._source.ToString()) : null, "source" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._startDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._expirationDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._expirationDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._poNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._poNumber.ToString()) : null, "poNumber" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._purchasedDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._purchasedDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "purchasedDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._creditCurrency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._creditCurrency.ToString()) : null, "creditCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingCurrency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingCurrency.ToString()) : null, "billingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._eTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/LotSummary.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LotSummary.PowerShell.cs new file mode 100644 index 000000000000..26e17bc28931 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LotSummary.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// A lot summary resource. + [System.ComponentModel.TypeConverter(typeof(LotSummaryTypeConverter))] + public partial class LotSummary + { + + /// + /// 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.Consumption.Models.Api20211001.ILotSummary DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LotSummary(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.Consumption.Models.Api20211001.ILotSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LotSummary(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.Consumption.Models.Api20211001.ILotSummary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LotSummary(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.Consumption.Models.Api20211001.ILotSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LotPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Reseller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Reseller = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller) content.GetValueForProperty("Reseller",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Reseller, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResellerTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status.CreateFrom); + } + if (content.Contains("OriginalAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmount = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("OriginalAmount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmount, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ClosedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ClosedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesOriginalAmountInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesOriginalAmountInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("PropertiesOriginalAmountInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesOriginalAmountInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesClosedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesClosedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("PropertiesClosedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesClosedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource.CreateFrom); + } + if (content.Contains("StartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).StartDate = (global::System.DateTime?) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).StartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ExpirationDate = (global::System.DateTime?) content.GetValueForProperty("ExpirationDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ExpirationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PoNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PoNumber = (string) content.GetValueForProperty("PoNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PoNumber, global::System.Convert.ToString); + } + if (content.Contains("PurchasedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PurchasedDate = (global::System.DateTime?) content.GetValueForProperty("PurchasedDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PurchasedDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).CreditCurrency = (string) content.GetValueForProperty("CreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).CreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("PropertiesETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesETag = (string) content.GetValueForProperty("PropertiesETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesETag, global::System.Convert.ToString); + } + if (content.Contains("ResellerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ResellerId = (string) content.GetValueForProperty("ResellerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ResellerId, global::System.Convert.ToString); + } + if (content.Contains("ResellerDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ResellerDescription = (string) content.GetValueForProperty("ResellerDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ResellerDescription, global::System.Convert.ToString); + } + if (content.Contains("OriginalAmountCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountCurrency = (string) content.GetValueForProperty("OriginalAmountCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountCurrency, global::System.Convert.ToString); + } + if (content.Contains("OriginalAmountValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountValue = (decimal?) content.GetValueForProperty("OriginalAmountValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceCurrency = (string) content.GetValueForProperty("ClosedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceValue = (decimal?) content.GetValueForProperty("ClosedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PropertiesOriginalAmountInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesOriginalAmountInBillingCurrencyCurrency = (string) content.GetValueForProperty("PropertiesOriginalAmountInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesOriginalAmountInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("OriginalAmountInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountInBillingCurrencyValue = (decimal?) content.GetValueForProperty("OriginalAmountInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OriginalAmountInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("OriginalAmountInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OriginalAmountInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("OriginalAmountInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertiesClosedBalanceInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesClosedBalanceInBillingCurrencyCurrency = (string) content.GetValueForProperty("PropertiesClosedBalanceInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesClosedBalanceInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth, (__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 LotSummary(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.Consumption.Models.Api20211001.ILotSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LotPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Reseller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Reseller = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller) content.GetValueForProperty("Reseller",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Reseller, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResellerTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status.CreateFrom); + } + if (content.Contains("OriginalAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmount = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("OriginalAmount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmount, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ClosedBalance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ClosedBalance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesOriginalAmountInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesOriginalAmountInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("PropertiesOriginalAmountInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesOriginalAmountInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesClosedBalanceInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesClosedBalanceInBillingCurrency = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate) content.GetValueForProperty("PropertiesClosedBalanceInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesClosedBalanceInBillingCurrency, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountWithExchangeRateTypeConverter.ConvertFrom); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource.CreateFrom); + } + if (content.Contains("StartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).StartDate = (global::System.DateTime?) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).StartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ExpirationDate = (global::System.DateTime?) content.GetValueForProperty("ExpirationDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ExpirationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PoNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PoNumber = (string) content.GetValueForProperty("PoNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PoNumber, global::System.Convert.ToString); + } + if (content.Contains("PurchasedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PurchasedDate = (global::System.DateTime?) content.GetValueForProperty("PurchasedDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PurchasedDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CreditCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).CreditCurrency = (string) content.GetValueForProperty("CreditCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).CreditCurrency, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).BillingCurrency = (string) content.GetValueForProperty("BillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).BillingCurrency, global::System.Convert.ToString); + } + if (content.Contains("PropertiesETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesETag = (string) content.GetValueForProperty("PropertiesETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesETag, global::System.Convert.ToString); + } + if (content.Contains("ResellerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ResellerId = (string) content.GetValueForProperty("ResellerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ResellerId, global::System.Convert.ToString); + } + if (content.Contains("ResellerDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ResellerDescription = (string) content.GetValueForProperty("ResellerDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ResellerDescription, global::System.Convert.ToString); + } + if (content.Contains("OriginalAmountCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountCurrency = (string) content.GetValueForProperty("OriginalAmountCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountCurrency, global::System.Convert.ToString); + } + if (content.Contains("OriginalAmountValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountValue = (decimal?) content.GetValueForProperty("OriginalAmountValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceCurrency = (string) content.GetValueForProperty("ClosedBalanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceValue = (decimal?) content.GetValueForProperty("ClosedBalanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PropertiesOriginalAmountInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesOriginalAmountInBillingCurrencyCurrency = (string) content.GetValueForProperty("PropertiesOriginalAmountInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesOriginalAmountInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("OriginalAmountInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountInBillingCurrencyValue = (decimal?) content.GetValueForProperty("OriginalAmountInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OriginalAmountInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("OriginalAmountInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OriginalAmountInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("OriginalAmountInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).OriginalAmountInBillingCurrencyExchangeRateMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertiesClosedBalanceInBillingCurrencyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesClosedBalanceInBillingCurrencyCurrency = (string) content.GetValueForProperty("PropertiesClosedBalanceInBillingCurrencyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).PropertiesClosedBalanceInBillingCurrencyCurrency, global::System.Convert.ToString); + } + if (content.Contains("ClosedBalanceInBillingCurrencyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceInBillingCurrencyValue = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceInBillingCurrencyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRate = (decimal?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ClosedBalanceInBillingCurrencyExchangeRateMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth = (int?) content.GetValueForProperty("ClosedBalanceInBillingCurrencyExchangeRateMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal)this).ClosedBalanceInBillingCurrencyExchangeRateMonth, (__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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A lot summary resource. + [System.ComponentModel.TypeConverter(typeof(LotSummaryTypeConverter))] + public partial interface ILotSummary + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LotSummary.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LotSummary.TypeConverter.cs new file mode 100644 index 000000000000..20bca100060f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LotSummary.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LotSummaryTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILotSummary ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LotSummary.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LotSummary.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LotSummary.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/consumption/generated/api/Models/Api20211001/LotSummary.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LotSummary.cs new file mode 100644 index 000000000000..3f3a758dc044 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LotSummary.cs @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A lot summary resource. + public partial class LotSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ProxyResource(); + + /// The billing currency of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).BillingCurrency; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ClosedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceCurrency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ClosedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrencyExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? ClosedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrencyExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ClosedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrencyValue; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ClosedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceValue; } + + /// The currency of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).CreditCurrency; } + + /// + /// 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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + + /// The expiration date of a lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? ExpirationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ExpirationDate; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + + /// Internal Acessors for BillingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.BillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).BillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).BillingCurrency = value; } + + /// Internal Acessors for ClosedBalance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.ClosedBalance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalance = value; } + + /// Internal Acessors for ClosedBalanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.ClosedBalanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceCurrency = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.ClosedBalanceInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrencyExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrencyExchangeRate = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.ClosedBalanceInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrencyExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrencyExchangeRateMonth = value; } + + /// Internal Acessors for ClosedBalanceInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.ClosedBalanceInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrencyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrencyValue = value; } + + /// Internal Acessors for ClosedBalanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.ClosedBalanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceValue = value; } + + /// Internal Acessors for CreditCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.CreditCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).CreditCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).CreditCurrency = value; } + + /// Internal Acessors for ExpirationDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.ExpirationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ExpirationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ExpirationDate = value; } + + /// Internal Acessors for OriginalAmount + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.OriginalAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmount = value; } + + /// Internal Acessors for OriginalAmountCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.OriginalAmountCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountCurrency = value; } + + /// Internal Acessors for OriginalAmountInBillingCurrencyExchangeRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.OriginalAmountInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrencyExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrencyExchangeRate = value; } + + /// Internal Acessors for OriginalAmountInBillingCurrencyExchangeRateMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.OriginalAmountInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrencyExchangeRateMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrencyExchangeRateMonth = value; } + + /// Internal Acessors for OriginalAmountInBillingCurrencyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.OriginalAmountInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrencyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrencyValue = value; } + + /// Internal Acessors for OriginalAmountValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.OriginalAmountValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountValue = value; } + + /// Internal Acessors for PoNumber + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.PoNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).PoNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).PoNumber = value; } + + /// Internal Acessors for PropertiesClosedBalanceInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.PropertiesClosedBalanceInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrency = value; } + + /// Internal Acessors for PropertiesClosedBalanceInBillingCurrencyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.PropertiesClosedBalanceInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrencyCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrencyCurrency = value; } + + /// Internal Acessors for PropertiesETag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.PropertiesETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ETag = value; } + + /// Internal Acessors for PropertiesOriginalAmountInBillingCurrency + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.PropertiesOriginalAmountInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrency = value; } + + /// Internal Acessors for PropertiesOriginalAmountInBillingCurrencyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.PropertiesOriginalAmountInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrencyCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrencyCurrency = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LotProperties()); set { {_property = value;} } } + + /// Internal Acessors for PurchasedDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.PurchasedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).PurchasedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).PurchasedDate = value; } + + /// Internal Acessors for Reseller + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.Reseller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).Reseller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).Reseller = value; } + + /// Internal Acessors for ResellerDescription + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.ResellerDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ResellerDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ResellerDescription = value; } + + /// Internal Acessors for ResellerId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.ResellerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ResellerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ResellerId = value; } + + /// Internal Acessors for Source + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).Source = value; } + + /// Internal Acessors for StartDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.StartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).StartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).StartDate = value; } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummaryInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).Status = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string OriginalAmountCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountCurrency; } + + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? OriginalAmountInBillingCurrencyExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrencyExchangeRate; } + + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? OriginalAmountInBillingCurrencyExchangeRateMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrencyExchangeRateMonth; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? OriginalAmountInBillingCurrencyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrencyValue; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? OriginalAmountValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountValue; } + + /// + /// The po number of the invoice on which the lot was added. This property is not available for ConsumptionCommitment lots. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PoNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).PoNumber; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PropertiesClosedBalanceInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ClosedBalanceInBillingCurrencyCurrency; } + + /// The eTag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PropertiesETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ETag; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PropertiesOriginalAmountInBillingCurrencyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).OriginalAmountInBillingCurrencyCurrency; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotProperties _property; + + /// The lot properties. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LotProperties()); set => this._property = value; } + + /// The date when the lot was added. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? PurchasedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).PurchasedDate; } + + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ResellerDescription; } + + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).ResellerId; } + + /// The source of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource? Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).Source; } + + /// The date when the lot became effective. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? StartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).StartDate; } + + /// The status of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotPropertiesInternal)Property).Status; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public LotSummary() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// A lot summary resource. + public partial interface ILotSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource + { + /// The billing currency of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing currency of the lot.", + SerializedName = @"billingCurrency", + PossibleTypes = new [] { typeof(string) })] + string BillingCurrency { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ClosedBalanceCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ClosedBalanceInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? ClosedBalanceInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ClosedBalanceInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ClosedBalanceValue { get; } + /// The currency of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The currency of the lot.", + SerializedName = @"creditCurrency", + PossibleTypes = new [] { typeof(string) })] + string CreditCurrency { get; } + /// The expiration date of a lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The expiration date of a lot.", + SerializedName = @"expirationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationDate { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string OriginalAmountCurrency { get; } + /// The exchange rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? OriginalAmountInBillingCurrencyExchangeRate { get; } + /// The exchange rate month. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exchange rate month.", + SerializedName = @"exchangeRateMonth", + PossibleTypes = new [] { typeof(int) })] + int? OriginalAmountInBillingCurrencyExchangeRateMonth { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? OriginalAmountInBillingCurrencyValue { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? OriginalAmountValue { get; } + /// + /// The po number of the invoice on which the lot was added. This property is not available for ConsumptionCommitment lots. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The po number of the invoice on which the lot was added. This property is not available for ConsumptionCommitment lots.", + SerializedName = @"poNumber", + PossibleTypes = new [] { typeof(string) })] + string PoNumber { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string PropertiesClosedBalanceInBillingCurrencyCurrency { get; } + /// The eTag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The eTag for the resource.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + string PropertiesETag { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string PropertiesOriginalAmountInBillingCurrencyCurrency { get; } + /// The date when the lot was added. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date when the lot was added.", + SerializedName = @"purchasedDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PurchasedDate { get; } + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property description.", + SerializedName = @"resellerDescription", + PossibleTypes = new [] { typeof(string) })] + string ResellerDescription { get; } + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property ID.", + SerializedName = @"resellerId", + PossibleTypes = new [] { typeof(string) })] + string ResellerId { get; } + /// The source of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The source of the lot.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource? Source { get; } + /// The date when the lot became effective. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date when the lot became effective.", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartDate { get; } + /// The status of the lot. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The status of the lot.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status? Status { get; } + + } + /// A lot summary resource. + internal partial interface ILotSummaryInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal + { + /// The billing currency of the lot. + string BillingCurrency { get; set; } + /// The balance as of the last invoice. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount ClosedBalance { get; set; } + /// Amount currency. + string ClosedBalanceCurrency { get; set; } + /// The exchange rate. + decimal? ClosedBalanceInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? ClosedBalanceInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? ClosedBalanceInBillingCurrencyValue { get; set; } + /// Amount. + decimal? ClosedBalanceValue { get; set; } + /// The currency of the lot. + string CreditCurrency { get; set; } + /// The expiration date of a lot. + global::System.DateTime? ExpirationDate { get; set; } + /// The original amount of a lot. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount OriginalAmount { get; set; } + /// Amount currency. + string OriginalAmountCurrency { get; set; } + /// The exchange rate. + decimal? OriginalAmountInBillingCurrencyExchangeRate { get; set; } + /// The exchange rate month. + int? OriginalAmountInBillingCurrencyExchangeRateMonth { get; set; } + /// Amount. + decimal? OriginalAmountInBillingCurrencyValue { get; set; } + /// Amount. + decimal? OriginalAmountValue { get; set; } + /// + /// The po number of the invoice on which the lot was added. This property is not available for ConsumptionCommitment lots. + /// + string PoNumber { get; set; } + /// The balance as of the last invoice in billing currency. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate PropertiesClosedBalanceInBillingCurrency { get; set; } + /// Amount currency. + string PropertiesClosedBalanceInBillingCurrencyCurrency { get; set; } + /// The eTag for the resource. + string PropertiesETag { get; set; } + /// The original amount of a lot in billing currency. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountWithExchangeRate PropertiesOriginalAmountInBillingCurrency { get; set; } + /// Amount currency. + string PropertiesOriginalAmountInBillingCurrencyCurrency { get; set; } + /// The lot properties. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotProperties Property { get; set; } + /// The date when the lot was added. + global::System.DateTime? PurchasedDate { get; set; } + /// The reseller of the lot. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller Reseller { get; set; } + /// The reseller property description. + string ResellerDescription { get; set; } + /// The reseller property ID. + string ResellerId { get; set; } + /// The source of the lot. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource? Source { get; set; } + /// The date when the lot became effective. + global::System.DateTime? StartDate { get; set; } + /// The status of the lot. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/LotSummary.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/LotSummary.json.cs new file mode 100644 index 000000000000..9f99014152b7 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/LotSummary.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A lot summary resource. + public partial class LotSummary + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new LotSummary(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal LotSummary(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LotProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/Lots.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Lots.PowerShell.cs new file mode 100644 index 000000000000..c8fce09ee06e --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Lots.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Result of listing lot summary. + [System.ComponentModel.TypeConverter(typeof(LotsTypeConverter))] + public partial class Lots + { + + /// + /// 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.Consumption.Models.Api20211001.ILots DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Lots(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.Consumption.Models.Api20211001.ILots DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Lots(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.Consumption.Models.Api20211001.ILots FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Lots(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.Consumption.Models.Api20211001.ILotsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LotSummaryTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotsInternal)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 Lots(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.Consumption.Models.Api20211001.ILotsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LotSummaryTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotsInternal)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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing lot summary. + [System.ComponentModel.TypeConverter(typeof(LotsTypeConverter))] + public partial interface ILots + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Lots.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Lots.TypeConverter.cs new file mode 100644 index 000000000000..41704fc6788f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Lots.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LotsTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ILots ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILots).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Lots.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Lots.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Lots.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/consumption/generated/api/Models/Api20211001/Lots.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Lots.cs new file mode 100644 index 000000000000..a4a5c40fadda --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Lots.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing lot summary. + public partial class Lots : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILots, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotsInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotsInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotsInternal.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary[] _value; + + /// The list of lot summary. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary[] Value { get => this._value; } + + /// Creates an new instance. + public Lots() + { + + } + } + /// Result of listing lot summary. + public partial interface ILots : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 lot summary. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of lot summary.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary[] Value { get; } + + } + /// Result of listing lot summary. + internal partial interface ILotsInternal + + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The list of lot summary. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Lots.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Lots.json.cs new file mode 100644 index 000000000000..89253ebdf8fa --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Lots.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing lot summary. + public partial class Lots + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILots. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILots. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILots FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new Lots(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal Lots(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.ILotSummary) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LotSummary.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostProperties.PowerShell.cs new file mode 100644 index 000000000000..3ea7b2a9f8e1 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostProperties.PowerShell.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the Management Group Aggregated Cost. + [System.ComponentModel.TypeConverter(typeof(ManagementGroupAggregatedCostPropertiesTypeConverter))] + public partial class ManagementGroupAggregatedCostProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagementGroupAggregatedCostProperties(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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagementGroupAggregatedCostProperties(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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagementGroupAggregatedCostProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)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("AzureCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).AzureCharge = (decimal?) content.GetValueForProperty("AzureCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).AzureCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MarketplaceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).MarketplaceCharge = (decimal?) content.GetValueForProperty("MarketplaceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).MarketplaceCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).ChargesBilledSeparately = (decimal?) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).ChargesBilledSeparately, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Child")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).Child = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult[]) content.GetValueForProperty("Child",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).Child, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostResultTypeConverter.ConvertFrom)); + } + if (content.Contains("IncludedSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).IncludedSubscription = (string[]) content.GetValueForProperty("IncludedSubscription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).IncludedSubscription, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExcludedSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).ExcludedSubscription = (string[]) content.GetValueForProperty("ExcludedSubscription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).ExcludedSubscription, __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 ManagementGroupAggregatedCostProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)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("AzureCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).AzureCharge = (decimal?) content.GetValueForProperty("AzureCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).AzureCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MarketplaceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).MarketplaceCharge = (decimal?) content.GetValueForProperty("MarketplaceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).MarketplaceCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).ChargesBilledSeparately = (decimal?) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).ChargesBilledSeparately, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Child")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).Child = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult[]) content.GetValueForProperty("Child",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).Child, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostResultTypeConverter.ConvertFrom)); + } + if (content.Contains("IncludedSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).IncludedSubscription = (string[]) content.GetValueForProperty("IncludedSubscription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).IncludedSubscription, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExcludedSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).ExcludedSubscription = (string[]) content.GetValueForProperty("ExcludedSubscription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)this).ExcludedSubscription, __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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the Management Group Aggregated Cost. + [System.ComponentModel.TypeConverter(typeof(ManagementGroupAggregatedCostPropertiesTypeConverter))] + public partial interface IManagementGroupAggregatedCostProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostProperties.TypeConverter.cs new file mode 100644 index 000000000000..8f886a1eefb7 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagementGroupAggregatedCostPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagementGroupAggregatedCostProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagementGroupAggregatedCostProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagementGroupAggregatedCostProperties.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/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostProperties.cs new file mode 100644 index 000000000000..8e27e6f91cca --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostProperties.cs @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the Management Group Aggregated Cost. + public partial class ManagementGroupAggregatedCostProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal + { + + /// Backing field for property. + private decimal? _azureCharge; + + /// Azure Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? AzureCharge { get => this._azureCharge; } + + /// Backing field for property. + private string _billingPeriodId; + + /// The id of the billing period resource that the aggregated cost belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingPeriodId { get => this._billingPeriodId; } + + /// Backing field for property. + private decimal? _chargesBilledSeparately; + + /// Charges Billed Separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? ChargesBilledSeparately { get => this._chargesBilledSeparately; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult[] _child; + + /// Children of a management group + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult[] Child { get => this._child; set => this._child = value; } + + /// Backing field for property. + private string _currency; + + /// The ISO currency in which the meter is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Currency { get => this._currency; } + + /// Backing field for property. + private string[] _excludedSubscription; + + /// List of subscription Guids excluded from the calculation of aggregated cost + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string[] ExcludedSubscription { get => this._excludedSubscription; set => this._excludedSubscription = value; } + + /// Backing field for property. + private string[] _includedSubscription; + + /// List of subscription Guids included in the calculation of aggregated cost + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string[] IncludedSubscription { get => this._includedSubscription; set => this._includedSubscription = value; } + + /// Backing field for property. + private decimal? _marketplaceCharge; + + /// Marketplace Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? MarketplaceCharge { get => this._marketplaceCharge; } + + /// Internal Acessors for AzureCharge + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal.AzureCharge { get => this._azureCharge; set { {_azureCharge = value;} } } + + /// Internal Acessors for BillingPeriodId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal.BillingPeriodId { get => this._billingPeriodId; set { {_billingPeriodId = value;} } } + + /// Internal Acessors for ChargesBilledSeparately + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal.ChargesBilledSeparately { get => this._chargesBilledSeparately; set { {_chargesBilledSeparately = value;} } } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal.Currency { get => this._currency; set { {_currency = value;} } } + + /// Internal Acessors for MarketplaceCharge + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal.MarketplaceCharge { get => this._marketplaceCharge; set { {_marketplaceCharge = value;} } } + + /// Internal Acessors for UsageEnd + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal.UsageEnd { get => this._usageEnd; set { {_usageEnd = value;} } } + + /// Internal Acessors for UsageStart + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal.UsageStart { get => this._usageStart; set { {_usageStart = value;} } } + + /// Backing field for property. + private global::System.DateTime? _usageEnd; + + /// The end of the date time range covered by the aggregated cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? UsageEnd { get => this._usageEnd; } + + /// Backing field for property. + private global::System.DateTime? _usageStart; + + /// The start of the date time range covered by aggregated cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? UsageStart { get => this._usageStart; } + + /// Creates an new instance. + public ManagementGroupAggregatedCostProperties() + { + + } + } + /// The properties of the Management Group Aggregated Cost. + public partial interface IManagementGroupAggregatedCostProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Azure Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure Charges.", + SerializedName = @"azureCharges", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AzureCharge { get; } + /// The id of the billing period resource that the aggregated cost belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The id of the billing period resource that the aggregated cost belongs to.", + SerializedName = @"billingPeriodId", + PossibleTypes = new [] { typeof(string) })] + string BillingPeriodId { get; } + /// Charges Billed Separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Charges Billed Separately.", + SerializedName = @"chargesBilledSeparately", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargesBilledSeparately { get; } + /// Children of a management group + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Children of a management group", + SerializedName = @"children", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult[] Child { get; set; } + /// The ISO currency in which the meter is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ISO currency in which the meter is charged, for example, USD.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// List of subscription Guids excluded from the calculation of aggregated cost + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of subscription Guids excluded from the calculation of aggregated cost", + SerializedName = @"excludedSubscriptions", + PossibleTypes = new [] { typeof(string) })] + string[] ExcludedSubscription { get; set; } + /// List of subscription Guids included in the calculation of aggregated cost + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of subscription Guids included in the calculation of aggregated cost", + SerializedName = @"includedSubscriptions", + PossibleTypes = new [] { typeof(string) })] + string[] IncludedSubscription { get; set; } + /// Marketplace Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Marketplace Charges.", + SerializedName = @"marketplaceCharges", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MarketplaceCharge { get; } + /// The end of the date time range covered by the aggregated cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The end of the date time range covered by the aggregated cost.", + SerializedName = @"usageEnd", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageEnd { get; } + /// The start of the date time range covered by aggregated cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The start of the date time range covered by aggregated cost.", + SerializedName = @"usageStart", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageStart { get; } + + } + /// The properties of the Management Group Aggregated Cost. + internal partial interface IManagementGroupAggregatedCostPropertiesInternal + + { + /// Azure Charges. + decimal? AzureCharge { get; set; } + /// The id of the billing period resource that the aggregated cost belongs to. + string BillingPeriodId { get; set; } + /// Charges Billed Separately. + decimal? ChargesBilledSeparately { get; set; } + /// Children of a management group + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult[] Child { get; set; } + /// The ISO currency in which the meter is charged, for example, USD. + string Currency { get; set; } + /// List of subscription Guids excluded from the calculation of aggregated cost + string[] ExcludedSubscription { get; set; } + /// List of subscription Guids included in the calculation of aggregated cost + string[] IncludedSubscription { get; set; } + /// Marketplace Charges. + decimal? MarketplaceCharge { get; set; } + /// The end of the date time range covered by the aggregated cost. + global::System.DateTime? UsageEnd { get; set; } + /// The start of the date time range covered by aggregated cost. + global::System.DateTime? UsageStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostProperties.json.cs new file mode 100644 index 000000000000..d9cef83dbf37 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostProperties.json.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the Management Group Aggregated Cost. + public partial class ManagementGroupAggregatedCostProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ManagementGroupAggregatedCostProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ManagementGroupAggregatedCostProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_billingPeriodId = If( json?.PropertyT("billingPeriodId"), out var __jsonBillingPeriodId) ? (string)__jsonBillingPeriodId : (string)BillingPeriodId;} + {_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;} + {_azureCharge = If( json?.PropertyT("azureCharges"), out var __jsonAzureCharges) ? (decimal?)__jsonAzureCharges : AzureCharge;} + {_marketplaceCharge = If( json?.PropertyT("marketplaceCharges"), out var __jsonMarketplaceCharges) ? (decimal?)__jsonMarketplaceCharges : MarketplaceCharge;} + {_chargesBilledSeparately = If( json?.PropertyT("chargesBilledSeparately"), out var __jsonChargesBilledSeparately) ? (decimal?)__jsonChargesBilledSeparately : ChargesBilledSeparately;} + {_currency = If( json?.PropertyT("currency"), out var __jsonCurrency) ? (string)__jsonCurrency : (string)Currency;} + {_child = If( json?.PropertyT("children"), out var __jsonChildren) ? If( __jsonChildren as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostResult.FromJson(__u) )) ))() : null : Child;} + {_includedSubscription = If( json?.PropertyT("includedSubscriptions"), out var __jsonIncludedSubscriptions) ? If( __jsonIncludedSubscriptions as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : IncludedSubscription;} + {_excludedSubscription = If( json?.PropertyT("excludedSubscriptions"), out var __jsonExcludedSubscriptions) ? If( __jsonExcludedSubscriptions as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : ExcludedSubscription;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingPeriodId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingPeriodId.ToString()) : null, "billingPeriodId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usageStart ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usageEnd ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._azureCharge ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._azureCharge) : null, "azureCharges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._marketplaceCharge ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._marketplaceCharge) : null, "marketplaceCharges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._chargesBilledSeparately ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._chargesBilledSeparately) : null, "chargesBilledSeparately" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._currency.ToString()) : null, "currency" ,container.Add ); + } + if (null != this._child) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._child ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("children",__w); + } + if (null != this._includedSubscription) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __s in this._includedSubscription ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("includedSubscriptions",__r); + } + if (null != this._excludedSubscription) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __n in this._excludedSubscription ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("excludedSubscriptions",__m); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostResult.PowerShell.cs new file mode 100644 index 000000000000..efb356ff0353 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostResult.PowerShell.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// A management group aggregated cost resource. + [System.ComponentModel.TypeConverter(typeof(ManagementGroupAggregatedCostResultTypeConverter))] + public partial class ManagementGroupAggregatedCostResult + { + + /// + /// 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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagementGroupAggregatedCostResult(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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagementGroupAggregatedCostResult(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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagementGroupAggregatedCostResult(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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)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("AzureCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).AzureCharge = (decimal?) content.GetValueForProperty("AzureCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).AzureCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MarketplaceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).MarketplaceCharge = (decimal?) content.GetValueForProperty("MarketplaceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).MarketplaceCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).ChargesBilledSeparately = (decimal?) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).ChargesBilledSeparately, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Child")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).Child = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult[]) content.GetValueForProperty("Child",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).Child, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostResultTypeConverter.ConvertFrom)); + } + if (content.Contains("IncludedSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).IncludedSubscription = (string[]) content.GetValueForProperty("IncludedSubscription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).IncludedSubscription, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExcludedSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).ExcludedSubscription = (string[]) content.GetValueForProperty("ExcludedSubscription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).ExcludedSubscription, __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 ManagementGroupAggregatedCostResult(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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)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("AzureCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).AzureCharge = (decimal?) content.GetValueForProperty("AzureCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).AzureCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MarketplaceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).MarketplaceCharge = (decimal?) content.GetValueForProperty("MarketplaceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).MarketplaceCharge, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).ChargesBilledSeparately = (decimal?) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).ChargesBilledSeparately, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Child")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).Child = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult[]) content.GetValueForProperty("Child",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).Child, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostResultTypeConverter.ConvertFrom)); + } + if (content.Contains("IncludedSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).IncludedSubscription = (string[]) content.GetValueForProperty("IncludedSubscription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).IncludedSubscription, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExcludedSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).ExcludedSubscription = (string[]) content.GetValueForProperty("ExcludedSubscription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal)this).ExcludedSubscription, __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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A management group aggregated cost resource. + [System.ComponentModel.TypeConverter(typeof(ManagementGroupAggregatedCostResultTypeConverter))] + public partial interface IManagementGroupAggregatedCostResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostResult.TypeConverter.cs new file mode 100644 index 000000000000..78d4f4f603ef --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostResult.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagementGroupAggregatedCostResultTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagementGroupAggregatedCostResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagementGroupAggregatedCostResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagementGroupAggregatedCostResult.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/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostResult.cs new file mode 100644 index 000000000000..899f6013f476 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostResult.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A management group aggregated cost resource. + public partial class ManagementGroupAggregatedCostResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(); + + /// Azure Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AzureCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).AzureCharge; } + + /// The id of the billing period resource that the aggregated cost belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingPeriodId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).BillingPeriodId; } + + /// Charges Billed Separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ChargesBilledSeparately { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).ChargesBilledSeparately; } + + /// Children of a management group + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult[] Child { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).Child; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).Child = value ?? null /* arrayOf */; } + + /// The ISO currency in which the meter is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).Currency; } + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; } + + /// List of subscription Guids excluded from the calculation of aggregated cost + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string[] ExcludedSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).ExcludedSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).ExcludedSubscription = value ?? null /* arrayOf */; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// List of subscription Guids included in the calculation of aggregated cost + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string[] IncludedSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).IncludedSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).IncludedSubscription = value ?? null /* arrayOf */; } + + /// Marketplace Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? MarketplaceCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).MarketplaceCharge; } + + /// Internal Acessors for AzureCharge + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal.AzureCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).AzureCharge; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).AzureCharge = value; } + + /// Internal Acessors for BillingPeriodId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal.BillingPeriodId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).BillingPeriodId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).BillingPeriodId = value; } + + /// Internal Acessors for ChargesBilledSeparately + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal.ChargesBilledSeparately { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).ChargesBilledSeparately; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).ChargesBilledSeparately = value; } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal.Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).Currency = value; } + + /// Internal Acessors for MarketplaceCharge + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal.MarketplaceCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).MarketplaceCharge; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).MarketplaceCharge = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostProperties()); set { {_property = value;} } } + + /// Internal Acessors for UsageEnd + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal.UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).UsageEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).UsageEnd = value; } + + /// Internal Acessors for UsageStart + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResultInternal.UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).UsageStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).UsageStart = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties _property; + + /// The properties of the Management Group Aggregated Cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostProperties()); set => this._property = value; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// The end of the date time range covered by the aggregated cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).UsageEnd; } + + /// The start of the date time range covered by aggregated cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostPropertiesInternal)Property).UsageStart; } + + /// Creates an new instance. + public ManagementGroupAggregatedCostResult() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// A management group aggregated cost resource. + public partial interface IManagementGroupAggregatedCostResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource + { + /// Azure Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure Charges.", + SerializedName = @"azureCharges", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AzureCharge { get; } + /// The id of the billing period resource that the aggregated cost belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The id of the billing period resource that the aggregated cost belongs to.", + SerializedName = @"billingPeriodId", + PossibleTypes = new [] { typeof(string) })] + string BillingPeriodId { get; } + /// Charges Billed Separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Charges Billed Separately.", + SerializedName = @"chargesBilledSeparately", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargesBilledSeparately { get; } + /// Children of a management group + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Children of a management group", + SerializedName = @"children", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult[] Child { get; set; } + /// The ISO currency in which the meter is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ISO currency in which the meter is charged, for example, USD.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// List of subscription Guids excluded from the calculation of aggregated cost + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of subscription Guids excluded from the calculation of aggregated cost", + SerializedName = @"excludedSubscriptions", + PossibleTypes = new [] { typeof(string) })] + string[] ExcludedSubscription { get; set; } + /// List of subscription Guids included in the calculation of aggregated cost + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of subscription Guids included in the calculation of aggregated cost", + SerializedName = @"includedSubscriptions", + PossibleTypes = new [] { typeof(string) })] + string[] IncludedSubscription { get; set; } + /// Marketplace Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Marketplace Charges.", + SerializedName = @"marketplaceCharges", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MarketplaceCharge { get; } + /// The end of the date time range covered by the aggregated cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The end of the date time range covered by the aggregated cost.", + SerializedName = @"usageEnd", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageEnd { get; } + /// The start of the date time range covered by aggregated cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The start of the date time range covered by aggregated cost.", + SerializedName = @"usageStart", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageStart { get; } + + } + /// A management group aggregated cost resource. + internal partial interface IManagementGroupAggregatedCostResultInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal + { + /// Azure Charges. + decimal? AzureCharge { get; set; } + /// The id of the billing period resource that the aggregated cost belongs to. + string BillingPeriodId { get; set; } + /// Charges Billed Separately. + decimal? ChargesBilledSeparately { get; set; } + /// Children of a management group + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult[] Child { get; set; } + /// The ISO currency in which the meter is charged, for example, USD. + string Currency { get; set; } + /// List of subscription Guids excluded from the calculation of aggregated cost + string[] ExcludedSubscription { get; set; } + /// List of subscription Guids included in the calculation of aggregated cost + string[] IncludedSubscription { get; set; } + /// Marketplace Charges. + decimal? MarketplaceCharge { get; set; } + /// The properties of the Management Group Aggregated Cost. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostProperties Property { get; set; } + /// The end of the date time range covered by the aggregated cost. + global::System.DateTime? UsageEnd { get; set; } + /// The start of the date time range covered by aggregated cost. + global::System.DateTime? UsageStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostResult.json.cs new file mode 100644 index 000000000000..63dcfd168f0d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ManagementGroupAggregatedCostResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A management group aggregated cost resource. + public partial class ManagementGroupAggregatedCostResult + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ManagementGroupAggregatedCostResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ManagementGroupAggregatedCostResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ManagementGroupAggregatedCostProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/Marketplace.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Marketplace.PowerShell.cs new file mode 100644 index 000000000000..3a445f7d52d8 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Marketplace.PowerShell.cs @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// A marketplace resource. + [System.ComponentModel.TypeConverter(typeof(MarketplaceTypeConverter))] + public partial class Marketplace + { + + /// + /// 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.Consumption.Models.Api20211001.IMarketplace DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Marketplace(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.Consumption.Models.Api20211001.IMarketplace DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Marketplace(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.Consumption.Models.Api20211001.IMarketplace FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Marketplace(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.Consumption.Models.Api20211001.IMarketplaceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MarketplacePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)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.Consumption.Models.Api20211001.IMarketplaceInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)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("ResourceRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ResourceRate = (decimal?) content.GetValueForProperty("ResourceRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ResourceRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OfferName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).OfferName = (string) content.GetValueForProperty("OfferName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).OfferName, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("OrderNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).OrderNumber = (string) content.GetValueForProperty("OrderNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).OrderNumber, global::System.Convert.ToString); + } + if (content.Contains("InstanceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).InstanceName = (string) content.GetValueForProperty("InstanceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).InstanceName, global::System.Convert.ToString); + } + if (content.Contains("InstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).InstanceId = (string) content.GetValueForProperty("InstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).InstanceId, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ConsumedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ConsumedQuantity = (decimal?) content.GetValueForProperty("ConsumedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ConsumedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).UnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("PretaxCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).PretaxCost = (decimal?) content.GetValueForProperty("PretaxCost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).PretaxCost, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("IsEstimated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).IsEstimated = (bool?) content.GetValueForProperty("IsEstimated",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).IsEstimated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).SubscriptionGuid = (string) content.GetValueForProperty("SubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).SubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).SubscriptionName = (string) content.GetValueForProperty("SubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).SubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("ConsumedService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ConsumedService = (string) content.GetValueForProperty("ConsumedService",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ConsumedService, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("AdditionalProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).AdditionalProperty = (string) content.GetValueForProperty("AdditionalProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).AdditionalProperty, global::System.Convert.ToString); + } + if (content.Contains("PublisherName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).PublisherName = (string) content.GetValueForProperty("PublisherName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).PublisherName, global::System.Convert.ToString); + } + if (content.Contains("PlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).PlanName, global::System.Convert.ToString); + } + if (content.Contains("IsRecurringCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).IsRecurringCharge = (bool?) content.GetValueForProperty("IsRecurringCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).IsRecurringCharge, (__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 Marketplace(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.Consumption.Models.Api20211001.IMarketplaceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MarketplacePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)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.Consumption.Models.Api20211001.IMarketplaceInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)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("ResourceRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ResourceRate = (decimal?) content.GetValueForProperty("ResourceRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ResourceRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OfferName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).OfferName = (string) content.GetValueForProperty("OfferName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).OfferName, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("OrderNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).OrderNumber = (string) content.GetValueForProperty("OrderNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).OrderNumber, global::System.Convert.ToString); + } + if (content.Contains("InstanceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).InstanceName = (string) content.GetValueForProperty("InstanceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).InstanceName, global::System.Convert.ToString); + } + if (content.Contains("InstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).InstanceId = (string) content.GetValueForProperty("InstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).InstanceId, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ConsumedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ConsumedQuantity = (decimal?) content.GetValueForProperty("ConsumedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ConsumedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).UnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("PretaxCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).PretaxCost = (decimal?) content.GetValueForProperty("PretaxCost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).PretaxCost, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("IsEstimated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).IsEstimated = (bool?) content.GetValueForProperty("IsEstimated",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).IsEstimated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).SubscriptionGuid = (string) content.GetValueForProperty("SubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).SubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).SubscriptionName = (string) content.GetValueForProperty("SubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).SubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("ConsumedService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ConsumedService = (string) content.GetValueForProperty("ConsumedService",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).ConsumedService, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("AdditionalProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).AdditionalProperty = (string) content.GetValueForProperty("AdditionalProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).AdditionalProperty, global::System.Convert.ToString); + } + if (content.Contains("PublisherName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).PublisherName = (string) content.GetValueForProperty("PublisherName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).PublisherName, global::System.Convert.ToString); + } + if (content.Contains("PlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).PlanName, global::System.Convert.ToString); + } + if (content.Contains("IsRecurringCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).IsRecurringCharge = (bool?) content.GetValueForProperty("IsRecurringCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal)this).IsRecurringCharge, (__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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A marketplace resource. + [System.ComponentModel.TypeConverter(typeof(MarketplaceTypeConverter))] + public partial interface IMarketplace + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Marketplace.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Marketplace.TypeConverter.cs new file mode 100644 index 000000000000..66b662838b50 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Marketplace.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MarketplaceTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IMarketplace ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Marketplace.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Marketplace.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Marketplace.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/consumption/generated/api/Models/Api20211001/Marketplace.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Marketplace.cs new file mode 100644 index 000000000000..471ba0b82e0e --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Marketplace.cs @@ -0,0 +1,554 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A marketplace resource. + public partial class Marketplace : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(); + + /// Account name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).AccountName; } + + /// Additional information. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).AdditionalInfo; } + + /// + /// Additional details of this usage item. By default this is not populated, unless it's specified in $expand. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AdditionalProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).AdditionalProperty; } + + /// The id of the billing period resource that the usage belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingPeriodId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).BillingPeriodId; } + + /// The quantity of usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ConsumedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).ConsumedQuantity; } + + /// Consumed service name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ConsumedService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).ConsumedService; } + + /// + /// The cost center of this department if it is a department and a costcenter exists + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CostCenter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).CostCenter; } + + /// The ISO currency in which the meter is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).Currency; } + + /// Department name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).DepartmentName; } + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// The uri of the resource instance that the usage is about. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).InstanceId; } + + /// The name of the resource instance that the usage is about. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InstanceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).InstanceName; } + + /// The estimated usage is subject to change. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public bool? IsEstimated { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).IsEstimated; } + + /// Flag indicating whether this is a recurring charge or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public bool? IsRecurringCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).IsRecurringCharge; } + + /// The meter id (GUID). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).MeterId; } + + /// Internal Acessors for AccountName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.AccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).AccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).AccountName = value; } + + /// Internal Acessors for AdditionalInfo + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).AdditionalInfo = value; } + + /// Internal Acessors for AdditionalProperty + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.AdditionalProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).AdditionalProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).AdditionalProperty = value; } + + /// Internal Acessors for BillingPeriodId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.BillingPeriodId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).BillingPeriodId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).BillingPeriodId = value; } + + /// Internal Acessors for ConsumedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.ConsumedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).ConsumedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).ConsumedQuantity = value; } + + /// Internal Acessors for ConsumedService + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.ConsumedService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).ConsumedService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).ConsumedService = value; } + + /// Internal Acessors for CostCenter + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.CostCenter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).CostCenter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).CostCenter = value; } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).Currency = value; } + + /// Internal Acessors for DepartmentName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.DepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).DepartmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).DepartmentName = value; } + + /// Internal Acessors for InstanceId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.InstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).InstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).InstanceId = value; } + + /// Internal Acessors for InstanceName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.InstanceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).InstanceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).InstanceName = value; } + + /// Internal Acessors for IsEstimated + bool? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.IsEstimated { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).IsEstimated; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).IsEstimated = value; } + + /// Internal Acessors for IsRecurringCharge + bool? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.IsRecurringCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).IsRecurringCharge; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).IsRecurringCharge = value; } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).MeterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).MeterId = value; } + + /// Internal Acessors for OfferName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.OfferName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).OfferName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).OfferName = value; } + + /// Internal Acessors for OrderNumber + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.OrderNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).OrderNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).OrderNumber = value; } + + /// Internal Acessors for PlanName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.PlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).PlanName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).PlanName = value; } + + /// Internal Acessors for PretaxCost + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.PretaxCost { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).PretaxCost; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).PretaxCost = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MarketplaceProperties()); set { {_property = value;} } } + + /// Internal Acessors for PublisherName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.PublisherName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).PublisherName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).PublisherName = value; } + + /// Internal Acessors for ResourceGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.ResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).ResourceGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).ResourceGroup = value; } + + /// Internal Acessors for ResourceRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.ResourceRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).ResourceRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).ResourceRate = value; } + + /// Internal Acessors for SubscriptionGuid + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.SubscriptionGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).SubscriptionGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).SubscriptionGuid = value; } + + /// Internal Acessors for SubscriptionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.SubscriptionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).SubscriptionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).SubscriptionName = value; } + + /// Internal Acessors for UnitOfMeasure + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.UnitOfMeasure { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).UnitOfMeasure; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).UnitOfMeasure = value; } + + /// Internal Acessors for UsageEnd + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).UsageEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).UsageEnd = value; } + + /// Internal Acessors for UsageStart + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceInternal.UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).UsageStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).UsageStart = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// The type of offer. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string OfferName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).OfferName; } + + /// The order number. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string OrderNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).OrderNumber; } + + /// The name of plan. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).PlanName; } + + /// The amount of cost before tax. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? PretaxCost { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).PretaxCost; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceProperties _property; + + /// The properties of the marketplace usage detail. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MarketplaceProperties()); set => this._property = value; } + + /// The name of publisher. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PublisherName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).PublisherName; } + + /// The name of resource group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).ResourceGroup; } + + /// The marketplace resource rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ResourceRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).ResourceRate; } + + /// Subscription guid. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SubscriptionGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).SubscriptionGuid; } + + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SubscriptionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).SubscriptionName; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// The unit of measure. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UnitOfMeasure { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).UnitOfMeasure; } + + /// The end of the date time range covered by the usage detail. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).UsageEnd; } + + /// The start of the date time range covered by the usage detail. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)Property).UsageStart; } + + /// Creates an new instance. + public Marketplace() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// A marketplace resource. + public partial interface IMarketplace : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource + { + /// Account name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Account name.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + string AccountName { get; } + /// Additional information. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Additional information.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(string) })] + string AdditionalInfo { get; } + /// + /// Additional details of this usage item. By default this is not populated, unless it's specified in $expand. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Additional details of this usage item. By default this is not populated, unless it's specified in $expand.", + SerializedName = @"additionalProperties", + PossibleTypes = new [] { typeof(string) })] + string AdditionalProperty { get; } + /// The id of the billing period resource that the usage belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The id of the billing period resource that the usage belongs to.", + SerializedName = @"billingPeriodId", + PossibleTypes = new [] { typeof(string) })] + string BillingPeriodId { get; } + /// The quantity of usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The quantity of usage.", + SerializedName = @"consumedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ConsumedQuantity { get; } + /// Consumed service name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Consumed service name.", + SerializedName = @"consumedService", + PossibleTypes = new [] { typeof(string) })] + string ConsumedService { get; } + /// + /// The cost center of this department if it is a department and a costcenter exists + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The cost center of this department if it is a department and a costcenter exists", + SerializedName = @"costCenter", + PossibleTypes = new [] { typeof(string) })] + string CostCenter { get; } + /// The ISO currency in which the meter is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ISO currency in which the meter is charged, for example, USD.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// Department name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Department name.", + SerializedName = @"departmentName", + PossibleTypes = new [] { typeof(string) })] + string DepartmentName { get; } + /// The uri of the resource instance that the usage is about. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The uri of the resource instance that the usage is about.", + SerializedName = @"instanceId", + PossibleTypes = new [] { typeof(string) })] + string InstanceId { get; } + /// The name of the resource instance that the usage is about. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the resource instance that the usage is about.", + SerializedName = @"instanceName", + PossibleTypes = new [] { typeof(string) })] + string InstanceName { get; } + /// The estimated usage is subject to change. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The estimated usage is subject to change.", + SerializedName = @"isEstimated", + PossibleTypes = new [] { typeof(bool) })] + bool? IsEstimated { get; } + /// Flag indicating whether this is a recurring charge or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Flag indicating whether this is a recurring charge or not.", + SerializedName = @"isRecurringCharge", + PossibleTypes = new [] { typeof(bool) })] + bool? IsRecurringCharge { get; } + /// The meter id (GUID). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter id (GUID).", + SerializedName = @"meterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// The type of offer. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of offer.", + SerializedName = @"offerName", + PossibleTypes = new [] { typeof(string) })] + string OfferName { get; } + /// The order number. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The order number.", + SerializedName = @"orderNumber", + PossibleTypes = new [] { typeof(string) })] + string OrderNumber { get; } + /// The name of plan. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of plan.", + SerializedName = @"planName", + PossibleTypes = new [] { typeof(string) })] + string PlanName { get; } + /// The amount of cost before tax. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The amount of cost before tax.", + SerializedName = @"pretaxCost", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PretaxCost { get; } + /// The name of publisher. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of publisher.", + SerializedName = @"publisherName", + PossibleTypes = new [] { typeof(string) })] + string PublisherName { get; } + /// The name of resource group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of resource group.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; } + /// The marketplace resource rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The marketplace resource rate.", + SerializedName = @"resourceRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ResourceRate { get; } + /// Subscription guid. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Subscription guid.", + SerializedName = @"subscriptionGuid", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionGuid { get; } + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Subscription name.", + SerializedName = @"subscriptionName", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionName { get; } + /// The unit of measure. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit of measure.", + SerializedName = @"unitOfMeasure", + PossibleTypes = new [] { typeof(string) })] + string UnitOfMeasure { get; } + /// The end of the date time range covered by the usage detail. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The end of the date time range covered by the usage detail.", + SerializedName = @"usageEnd", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageEnd { get; } + /// The start of the date time range covered by the usage detail. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The start of the date time range covered by the usage detail.", + SerializedName = @"usageStart", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageStart { get; } + + } + /// A marketplace resource. + internal partial interface IMarketplaceInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal + { + /// Account name. + string AccountName { get; set; } + /// Additional information. + string AdditionalInfo { get; set; } + /// + /// Additional details of this usage item. By default this is not populated, unless it's specified in $expand. + /// + string AdditionalProperty { get; set; } + /// The id of the billing period resource that the usage belongs to. + string BillingPeriodId { get; set; } + /// The quantity of usage. + decimal? ConsumedQuantity { get; set; } + /// Consumed service name. + string ConsumedService { get; set; } + /// + /// The cost center of this department if it is a department and a costcenter exists + /// + string CostCenter { get; set; } + /// The ISO currency in which the meter is charged, for example, USD. + string Currency { get; set; } + /// Department name. + string DepartmentName { get; set; } + /// The uri of the resource instance that the usage is about. + string InstanceId { get; set; } + /// The name of the resource instance that the usage is about. + string InstanceName { get; set; } + /// The estimated usage is subject to change. + bool? IsEstimated { get; set; } + /// Flag indicating whether this is a recurring charge or not. + bool? IsRecurringCharge { get; set; } + /// The meter id (GUID). + string MeterId { get; set; } + /// The type of offer. + string OfferName { get; set; } + /// The order number. + string OrderNumber { get; set; } + /// The name of plan. + string PlanName { get; set; } + /// The amount of cost before tax. + decimal? PretaxCost { get; set; } + /// The properties of the marketplace usage detail. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceProperties Property { get; set; } + /// The name of publisher. + string PublisherName { get; set; } + /// The name of resource group. + string ResourceGroup { get; set; } + /// The marketplace resource rate. + decimal? ResourceRate { get; set; } + /// Subscription guid. + string SubscriptionGuid { get; set; } + /// Subscription name. + string SubscriptionName { get; set; } + /// The unit of measure. + string UnitOfMeasure { get; set; } + /// The end of the date time range covered by the usage detail. + global::System.DateTime? UsageEnd { get; set; } + /// The start of the date time range covered by the usage detail. + global::System.DateTime? UsageStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Marketplace.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Marketplace.json.cs new file mode 100644 index 000000000000..d0d49919f4a8 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Marketplace.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A marketplace resource. + public partial class Marketplace + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new Marketplace(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal Marketplace(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MarketplaceProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/MarketplaceProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplaceProperties.PowerShell.cs new file mode 100644 index 000000000000..991858440d74 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplaceProperties.PowerShell.cs @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the marketplace usage detail. + [System.ComponentModel.TypeConverter(typeof(MarketplacePropertiesTypeConverter))] + public partial class MarketplaceProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IMarketplaceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MarketplaceProperties(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.Consumption.Models.Api20211001.IMarketplaceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MarketplaceProperties(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.Consumption.Models.Api20211001.IMarketplaceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MarketplaceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)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.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)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("ResourceRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ResourceRate = (decimal?) content.GetValueForProperty("ResourceRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ResourceRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OfferName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).OfferName = (string) content.GetValueForProperty("OfferName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).OfferName, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("OrderNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).OrderNumber = (string) content.GetValueForProperty("OrderNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).OrderNumber, global::System.Convert.ToString); + } + if (content.Contains("InstanceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).InstanceName = (string) content.GetValueForProperty("InstanceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).InstanceName, global::System.Convert.ToString); + } + if (content.Contains("InstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).InstanceId = (string) content.GetValueForProperty("InstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).InstanceId, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ConsumedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ConsumedQuantity = (decimal?) content.GetValueForProperty("ConsumedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ConsumedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).UnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("PretaxCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).PretaxCost = (decimal?) content.GetValueForProperty("PretaxCost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).PretaxCost, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("IsEstimated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).IsEstimated = (bool?) content.GetValueForProperty("IsEstimated",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).IsEstimated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).SubscriptionGuid = (string) content.GetValueForProperty("SubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).SubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).SubscriptionName = (string) content.GetValueForProperty("SubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).SubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("ConsumedService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ConsumedService = (string) content.GetValueForProperty("ConsumedService",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ConsumedService, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("AdditionalProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).AdditionalProperty = (string) content.GetValueForProperty("AdditionalProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).AdditionalProperty, global::System.Convert.ToString); + } + if (content.Contains("PublisherName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).PublisherName = (string) content.GetValueForProperty("PublisherName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).PublisherName, global::System.Convert.ToString); + } + if (content.Contains("PlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).PlanName, global::System.Convert.ToString); + } + if (content.Contains("IsRecurringCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).IsRecurringCharge = (bool?) content.GetValueForProperty("IsRecurringCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).IsRecurringCharge, (__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 MarketplaceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)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.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)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("ResourceRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ResourceRate = (decimal?) content.GetValueForProperty("ResourceRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ResourceRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("OfferName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).OfferName = (string) content.GetValueForProperty("OfferName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).OfferName, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("OrderNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).OrderNumber = (string) content.GetValueForProperty("OrderNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).OrderNumber, global::System.Convert.ToString); + } + if (content.Contains("InstanceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).InstanceName = (string) content.GetValueForProperty("InstanceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).InstanceName, global::System.Convert.ToString); + } + if (content.Contains("InstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).InstanceId = (string) content.GetValueForProperty("InstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).InstanceId, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ConsumedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ConsumedQuantity = (decimal?) content.GetValueForProperty("ConsumedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ConsumedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).UnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("PretaxCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).PretaxCost = (decimal?) content.GetValueForProperty("PretaxCost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).PretaxCost, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("IsEstimated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).IsEstimated = (bool?) content.GetValueForProperty("IsEstimated",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).IsEstimated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).SubscriptionGuid = (string) content.GetValueForProperty("SubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).SubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).SubscriptionName = (string) content.GetValueForProperty("SubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).SubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("ConsumedService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ConsumedService = (string) content.GetValueForProperty("ConsumedService",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).ConsumedService, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("AdditionalProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).AdditionalProperty = (string) content.GetValueForProperty("AdditionalProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).AdditionalProperty, global::System.Convert.ToString); + } + if (content.Contains("PublisherName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).PublisherName = (string) content.GetValueForProperty("PublisherName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).PublisherName, global::System.Convert.ToString); + } + if (content.Contains("PlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).PlanName, global::System.Convert.ToString); + } + if (content.Contains("IsRecurringCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).IsRecurringCharge = (bool?) content.GetValueForProperty("IsRecurringCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal)this).IsRecurringCharge, (__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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the marketplace usage detail. + [System.ComponentModel.TypeConverter(typeof(MarketplacePropertiesTypeConverter))] + public partial interface IMarketplaceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/MarketplaceProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplaceProperties.TypeConverter.cs new file mode 100644 index 000000000000..436a51a7579a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplaceProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MarketplacePropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IMarketplaceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MarketplaceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MarketplaceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MarketplaceProperties.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/consumption/generated/api/Models/Api20211001/MarketplaceProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplaceProperties.cs new file mode 100644 index 000000000000..a3fc6f0b6316 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplaceProperties.cs @@ -0,0 +1,566 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the marketplace usage detail. + public partial class MarketplaceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal + { + + /// Backing field for property. + private string _accountName; + + /// Account name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string AccountName { get => this._accountName; } + + /// Backing field for property. + private string _additionalInfo; + + /// Additional information. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string AdditionalInfo { get => this._additionalInfo; } + + /// Backing field for property. + private string _additionalProperty; + + /// + /// Additional details of this usage item. By default this is not populated, unless it's specified in $expand. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string AdditionalProperty { get => this._additionalProperty; } + + /// Backing field for property. + private string _billingPeriodId; + + /// The id of the billing period resource that the usage belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingPeriodId { get => this._billingPeriodId; } + + /// Backing field for property. + private decimal? _consumedQuantity; + + /// The quantity of usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? ConsumedQuantity { get => this._consumedQuantity; } + + /// Backing field for property. + private string _consumedService; + + /// Consumed service name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ConsumedService { get => this._consumedService; } + + /// Backing field for property. + private string _costCenter; + + /// + /// The cost center of this department if it is a department and a costcenter exists + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CostCenter { get => this._costCenter; } + + /// Backing field for property. + private string _currency; + + /// The ISO currency in which the meter is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Currency { get => this._currency; } + + /// Backing field for property. + private string _departmentName; + + /// Department name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string DepartmentName { get => this._departmentName; } + + /// Backing field for property. + private string _instanceId; + + /// The uri of the resource instance that the usage is about. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InstanceId { get => this._instanceId; } + + /// Backing field for property. + private string _instanceName; + + /// The name of the resource instance that the usage is about. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InstanceName { get => this._instanceName; } + + /// Backing field for property. + private bool? _isEstimated; + + /// The estimated usage is subject to change. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public bool? IsEstimated { get => this._isEstimated; } + + /// Backing field for property. + private bool? _isRecurringCharge; + + /// Flag indicating whether this is a recurring charge or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public bool? IsRecurringCharge { get => this._isRecurringCharge; } + + /// Backing field for property. + private string _meterId; + + /// The meter id (GUID). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterId { get => this._meterId; } + + /// Internal Acessors for AccountName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.AccountName { get => this._accountName; set { {_accountName = value;} } } + + /// Internal Acessors for AdditionalInfo + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + + /// Internal Acessors for AdditionalProperty + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.AdditionalProperty { get => this._additionalProperty; set { {_additionalProperty = value;} } } + + /// Internal Acessors for BillingPeriodId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.BillingPeriodId { get => this._billingPeriodId; set { {_billingPeriodId = value;} } } + + /// Internal Acessors for ConsumedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.ConsumedQuantity { get => this._consumedQuantity; set { {_consumedQuantity = value;} } } + + /// Internal Acessors for ConsumedService + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.ConsumedService { get => this._consumedService; set { {_consumedService = value;} } } + + /// Internal Acessors for CostCenter + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.CostCenter { get => this._costCenter; set { {_costCenter = value;} } } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.Currency { get => this._currency; set { {_currency = value;} } } + + /// Internal Acessors for DepartmentName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.DepartmentName { get => this._departmentName; set { {_departmentName = value;} } } + + /// Internal Acessors for InstanceId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.InstanceId { get => this._instanceId; set { {_instanceId = value;} } } + + /// Internal Acessors for InstanceName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.InstanceName { get => this._instanceName; set { {_instanceName = value;} } } + + /// Internal Acessors for IsEstimated + bool? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.IsEstimated { get => this._isEstimated; set { {_isEstimated = value;} } } + + /// Internal Acessors for IsRecurringCharge + bool? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.IsRecurringCharge { get => this._isRecurringCharge; set { {_isRecurringCharge = value;} } } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.MeterId { get => this._meterId; set { {_meterId = value;} } } + + /// Internal Acessors for OfferName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.OfferName { get => this._offerName; set { {_offerName = value;} } } + + /// Internal Acessors for OrderNumber + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.OrderNumber { get => this._orderNumber; set { {_orderNumber = value;} } } + + /// Internal Acessors for PlanName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.PlanName { get => this._planName; set { {_planName = value;} } } + + /// Internal Acessors for PretaxCost + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.PretaxCost { get => this._pretaxCost; set { {_pretaxCost = value;} } } + + /// Internal Acessors for PublisherName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.PublisherName { get => this._publisherName; set { {_publisherName = value;} } } + + /// Internal Acessors for ResourceGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.ResourceGroup { get => this._resourceGroup; set { {_resourceGroup = value;} } } + + /// Internal Acessors for ResourceRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.ResourceRate { get => this._resourceRate; set { {_resourceRate = value;} } } + + /// Internal Acessors for SubscriptionGuid + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.SubscriptionGuid { get => this._subscriptionGuid; set { {_subscriptionGuid = value;} } } + + /// Internal Acessors for SubscriptionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.SubscriptionName { get => this._subscriptionName; set { {_subscriptionName = value;} } } + + /// Internal Acessors for UnitOfMeasure + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.UnitOfMeasure { get => this._unitOfMeasure; set { {_unitOfMeasure = value;} } } + + /// Internal Acessors for UsageEnd + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.UsageEnd { get => this._usageEnd; set { {_usageEnd = value;} } } + + /// Internal Acessors for UsageStart + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacePropertiesInternal.UsageStart { get => this._usageStart; set { {_usageStart = value;} } } + + /// Backing field for property. + private string _offerName; + + /// The type of offer. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string OfferName { get => this._offerName; } + + /// Backing field for property. + private string _orderNumber; + + /// The order number. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string OrderNumber { get => this._orderNumber; } + + /// Backing field for property. + private string _planName; + + /// The name of plan. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PlanName { get => this._planName; } + + /// Backing field for property. + private decimal? _pretaxCost; + + /// The amount of cost before tax. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? PretaxCost { get => this._pretaxCost; } + + /// Backing field for property. + private string _publisherName; + + /// The name of publisher. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PublisherName { get => this._publisherName; } + + /// Backing field for property. + private string _resourceGroup; + + /// The name of resource group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceGroup { get => this._resourceGroup; } + + /// Backing field for property. + private decimal? _resourceRate; + + /// The marketplace resource rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? ResourceRate { get => this._resourceRate; } + + /// Backing field for property. + private string _subscriptionGuid; + + /// Subscription guid. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SubscriptionGuid { get => this._subscriptionGuid; } + + /// Backing field for property. + private string _subscriptionName; + + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SubscriptionName { get => this._subscriptionName; } + + /// Backing field for property. + private string _unitOfMeasure; + + /// The unit of measure. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string UnitOfMeasure { get => this._unitOfMeasure; } + + /// Backing field for property. + private global::System.DateTime? _usageEnd; + + /// The end of the date time range covered by the usage detail. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? UsageEnd { get => this._usageEnd; } + + /// Backing field for property. + private global::System.DateTime? _usageStart; + + /// The start of the date time range covered by the usage detail. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? UsageStart { get => this._usageStart; } + + /// Creates an new instance. + public MarketplaceProperties() + { + + } + } + /// The properties of the marketplace usage detail. + public partial interface IMarketplaceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Account name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Account name.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + string AccountName { get; } + /// Additional information. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Additional information.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(string) })] + string AdditionalInfo { get; } + /// + /// Additional details of this usage item. By default this is not populated, unless it's specified in $expand. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Additional details of this usage item. By default this is not populated, unless it's specified in $expand.", + SerializedName = @"additionalProperties", + PossibleTypes = new [] { typeof(string) })] + string AdditionalProperty { get; } + /// The id of the billing period resource that the usage belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The id of the billing period resource that the usage belongs to.", + SerializedName = @"billingPeriodId", + PossibleTypes = new [] { typeof(string) })] + string BillingPeriodId { get; } + /// The quantity of usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The quantity of usage.", + SerializedName = @"consumedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ConsumedQuantity { get; } + /// Consumed service name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Consumed service name.", + SerializedName = @"consumedService", + PossibleTypes = new [] { typeof(string) })] + string ConsumedService { get; } + /// + /// The cost center of this department if it is a department and a costcenter exists + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The cost center of this department if it is a department and a costcenter exists", + SerializedName = @"costCenter", + PossibleTypes = new [] { typeof(string) })] + string CostCenter { get; } + /// The ISO currency in which the meter is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ISO currency in which the meter is charged, for example, USD.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// Department name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Department name.", + SerializedName = @"departmentName", + PossibleTypes = new [] { typeof(string) })] + string DepartmentName { get; } + /// The uri of the resource instance that the usage is about. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The uri of the resource instance that the usage is about.", + SerializedName = @"instanceId", + PossibleTypes = new [] { typeof(string) })] + string InstanceId { get; } + /// The name of the resource instance that the usage is about. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the resource instance that the usage is about.", + SerializedName = @"instanceName", + PossibleTypes = new [] { typeof(string) })] + string InstanceName { get; } + /// The estimated usage is subject to change. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The estimated usage is subject to change.", + SerializedName = @"isEstimated", + PossibleTypes = new [] { typeof(bool) })] + bool? IsEstimated { get; } + /// Flag indicating whether this is a recurring charge or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Flag indicating whether this is a recurring charge or not.", + SerializedName = @"isRecurringCharge", + PossibleTypes = new [] { typeof(bool) })] + bool? IsRecurringCharge { get; } + /// The meter id (GUID). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter id (GUID).", + SerializedName = @"meterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// The type of offer. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of offer.", + SerializedName = @"offerName", + PossibleTypes = new [] { typeof(string) })] + string OfferName { get; } + /// The order number. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The order number.", + SerializedName = @"orderNumber", + PossibleTypes = new [] { typeof(string) })] + string OrderNumber { get; } + /// The name of plan. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of plan.", + SerializedName = @"planName", + PossibleTypes = new [] { typeof(string) })] + string PlanName { get; } + /// The amount of cost before tax. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The amount of cost before tax.", + SerializedName = @"pretaxCost", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PretaxCost { get; } + /// The name of publisher. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of publisher.", + SerializedName = @"publisherName", + PossibleTypes = new [] { typeof(string) })] + string PublisherName { get; } + /// The name of resource group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of resource group.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; } + /// The marketplace resource rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The marketplace resource rate.", + SerializedName = @"resourceRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ResourceRate { get; } + /// Subscription guid. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Subscription guid.", + SerializedName = @"subscriptionGuid", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionGuid { get; } + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Subscription name.", + SerializedName = @"subscriptionName", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionName { get; } + /// The unit of measure. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit of measure.", + SerializedName = @"unitOfMeasure", + PossibleTypes = new [] { typeof(string) })] + string UnitOfMeasure { get; } + /// The end of the date time range covered by the usage detail. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The end of the date time range covered by the usage detail.", + SerializedName = @"usageEnd", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageEnd { get; } + /// The start of the date time range covered by the usage detail. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The start of the date time range covered by the usage detail.", + SerializedName = @"usageStart", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageStart { get; } + + } + /// The properties of the marketplace usage detail. + internal partial interface IMarketplacePropertiesInternal + + { + /// Account name. + string AccountName { get; set; } + /// Additional information. + string AdditionalInfo { get; set; } + /// + /// Additional details of this usage item. By default this is not populated, unless it's specified in $expand. + /// + string AdditionalProperty { get; set; } + /// The id of the billing period resource that the usage belongs to. + string BillingPeriodId { get; set; } + /// The quantity of usage. + decimal? ConsumedQuantity { get; set; } + /// Consumed service name. + string ConsumedService { get; set; } + /// + /// The cost center of this department if it is a department and a costcenter exists + /// + string CostCenter { get; set; } + /// The ISO currency in which the meter is charged, for example, USD. + string Currency { get; set; } + /// Department name. + string DepartmentName { get; set; } + /// The uri of the resource instance that the usage is about. + string InstanceId { get; set; } + /// The name of the resource instance that the usage is about. + string InstanceName { get; set; } + /// The estimated usage is subject to change. + bool? IsEstimated { get; set; } + /// Flag indicating whether this is a recurring charge or not. + bool? IsRecurringCharge { get; set; } + /// The meter id (GUID). + string MeterId { get; set; } + /// The type of offer. + string OfferName { get; set; } + /// The order number. + string OrderNumber { get; set; } + /// The name of plan. + string PlanName { get; set; } + /// The amount of cost before tax. + decimal? PretaxCost { get; set; } + /// The name of publisher. + string PublisherName { get; set; } + /// The name of resource group. + string ResourceGroup { get; set; } + /// The marketplace resource rate. + decimal? ResourceRate { get; set; } + /// Subscription guid. + string SubscriptionGuid { get; set; } + /// Subscription name. + string SubscriptionName { get; set; } + /// The unit of measure. + string UnitOfMeasure { get; set; } + /// The end of the date time range covered by the usage detail. + global::System.DateTime? UsageEnd { get; set; } + /// The start of the date time range covered by the usage detail. + global::System.DateTime? UsageStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/MarketplaceProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplaceProperties.json.cs new file mode 100644 index 000000000000..481b2c3fb81d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplaceProperties.json.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the marketplace usage detail. + public partial class MarketplaceProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplaceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new MarketplaceProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal MarketplaceProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_billingPeriodId = If( json?.PropertyT("billingPeriodId"), out var __jsonBillingPeriodId) ? (string)__jsonBillingPeriodId : (string)BillingPeriodId;} + {_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;} + {_resourceRate = If( json?.PropertyT("resourceRate"), out var __jsonResourceRate) ? (decimal?)__jsonResourceRate : ResourceRate;} + {_offerName = If( json?.PropertyT("offerName"), out var __jsonOfferName) ? (string)__jsonOfferName : (string)OfferName;} + {_resourceGroup = If( json?.PropertyT("resourceGroup"), out var __jsonResourceGroup) ? (string)__jsonResourceGroup : (string)ResourceGroup;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? (string)__jsonAdditionalInfo : (string)AdditionalInfo;} + {_orderNumber = If( json?.PropertyT("orderNumber"), out var __jsonOrderNumber) ? (string)__jsonOrderNumber : (string)OrderNumber;} + {_instanceName = If( json?.PropertyT("instanceName"), out var __jsonInstanceName) ? (string)__jsonInstanceName : (string)InstanceName;} + {_instanceId = If( json?.PropertyT("instanceId"), out var __jsonInstanceId) ? (string)__jsonInstanceId : (string)InstanceId;} + {_currency = If( json?.PropertyT("currency"), out var __jsonCurrency) ? (string)__jsonCurrency : (string)Currency;} + {_consumedQuantity = If( json?.PropertyT("consumedQuantity"), out var __jsonConsumedQuantity) ? (decimal?)__jsonConsumedQuantity : ConsumedQuantity;} + {_unitOfMeasure = If( json?.PropertyT("unitOfMeasure"), out var __jsonUnitOfMeasure) ? (string)__jsonUnitOfMeasure : (string)UnitOfMeasure;} + {_pretaxCost = If( json?.PropertyT("pretaxCost"), out var __jsonPretaxCost) ? (decimal?)__jsonPretaxCost : PretaxCost;} + {_isEstimated = If( json?.PropertyT("isEstimated"), out var __jsonIsEstimated) ? (bool?)__jsonIsEstimated : IsEstimated;} + {_meterId = If( json?.PropertyT("meterId"), out var __jsonMeterId) ? (string)__jsonMeterId : (string)MeterId;} + {_subscriptionGuid = If( json?.PropertyT("subscriptionGuid"), out var __jsonSubscriptionGuid) ? (string)__jsonSubscriptionGuid : (string)SubscriptionGuid;} + {_subscriptionName = If( json?.PropertyT("subscriptionName"), out var __jsonSubscriptionName) ? (string)__jsonSubscriptionName : (string)SubscriptionName;} + {_accountName = If( json?.PropertyT("accountName"), out var __jsonAccountName) ? (string)__jsonAccountName : (string)AccountName;} + {_departmentName = If( json?.PropertyT("departmentName"), out var __jsonDepartmentName) ? (string)__jsonDepartmentName : (string)DepartmentName;} + {_consumedService = If( json?.PropertyT("consumedService"), out var __jsonConsumedService) ? (string)__jsonConsumedService : (string)ConsumedService;} + {_costCenter = If( json?.PropertyT("costCenter"), out var __jsonCostCenter) ? (string)__jsonCostCenter : (string)CostCenter;} + {_additionalProperty = If( json?.PropertyT("additionalProperties"), out var __jsonAdditionalProperties) ? (string)__jsonAdditionalProperties : (string)AdditionalProperty;} + {_publisherName = If( json?.PropertyT("publisherName"), out var __jsonPublisherName) ? (string)__jsonPublisherName : (string)PublisherName;} + {_planName = If( json?.PropertyT("planName"), out var __jsonPlanName) ? (string)__jsonPlanName : (string)PlanName;} + {_isRecurringCharge = If( json?.PropertyT("isRecurringCharge"), out var __jsonIsRecurringCharge) ? (bool?)__jsonIsRecurringCharge : IsRecurringCharge;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingPeriodId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingPeriodId.ToString()) : null, "billingPeriodId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usageStart ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usageEnd ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._resourceRate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._resourceRate) : null, "resourceRate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._offerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._offerName.ToString()) : null, "offerName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceGroup.ToString()) : null, "resourceGroup" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._additionalInfo)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._additionalInfo.ToString()) : null, "additionalInfo" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._orderNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._orderNumber.ToString()) : null, "orderNumber" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._instanceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._instanceName.ToString()) : null, "instanceName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._instanceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._instanceId.ToString()) : null, "instanceId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._currency.ToString()) : null, "currency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._consumedQuantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._consumedQuantity) : null, "consumedQuantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._unitOfMeasure)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._unitOfMeasure.ToString()) : null, "unitOfMeasure" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._pretaxCost ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._pretaxCost) : null, "pretaxCost" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isEstimated ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonBoolean((bool)this._isEstimated) : null, "isEstimated" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterId.ToString()) : null, "meterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._subscriptionGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._subscriptionGuid.ToString()) : null, "subscriptionGuid" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._subscriptionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._subscriptionName.ToString()) : null, "subscriptionName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._accountName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._accountName.ToString()) : null, "accountName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._departmentName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._departmentName.ToString()) : null, "departmentName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._consumedService)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._consumedService.ToString()) : null, "consumedService" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._costCenter)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._costCenter.ToString()) : null, "costCenter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._additionalProperty)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._additionalProperty.ToString()) : null, "additionalProperties" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._publisherName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._publisherName.ToString()) : null, "publisherName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._planName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._planName.ToString()) : null, "planName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isRecurringCharge ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonBoolean((bool)this._isRecurringCharge) : null, "isRecurringCharge" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/MarketplacesListResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplacesListResult.PowerShell.cs new file mode 100644 index 000000000000..a806206a874d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplacesListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// Result of listing marketplaces. It contains a list of available marketplaces in reverse chronological order by billing + /// period. + /// + [System.ComponentModel.TypeConverter(typeof(MarketplacesListResultTypeConverter))] + public partial class MarketplacesListResult + { + + /// + /// 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.Consumption.Models.Api20211001.IMarketplacesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MarketplacesListResult(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.Consumption.Models.Api20211001.IMarketplacesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MarketplacesListResult(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.Consumption.Models.Api20211001.IMarketplacesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MarketplacesListResult(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.Consumption.Models.Api20211001.IMarketplacesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MarketplaceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResultInternal)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 MarketplacesListResult(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.Consumption.Models.Api20211001.IMarketplacesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MarketplaceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResultInternal)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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing marketplaces. It contains a list of available marketplaces in reverse chronological order by billing + /// period. + [System.ComponentModel.TypeConverter(typeof(MarketplacesListResultTypeConverter))] + public partial interface IMarketplacesListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/MarketplacesListResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplacesListResult.TypeConverter.cs new file mode 100644 index 000000000000..3e539a7cd7b8 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplacesListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MarketplacesListResultTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IMarketplacesListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MarketplacesListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MarketplacesListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MarketplacesListResult.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/consumption/generated/api/Models/Api20211001/MarketplacesListResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplacesListResult.cs new file mode 100644 index 000000000000..63af68599a2d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplacesListResult.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Result of listing marketplaces. It contains a list of available marketplaces in reverse chronological order by billing + /// period. + /// + public partial class MarketplacesListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResultInternal.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace[] _value; + + /// The list of marketplaces. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace[] Value { get => this._value; } + + /// Creates an new instance. + public MarketplacesListResult() + { + + } + } + /// Result of listing marketplaces. It contains a list of available marketplaces in reverse chronological order by billing + /// period. + public partial interface IMarketplacesListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 marketplaces. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of marketplaces.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace[] Value { get; } + + } + /// Result of listing marketplaces. It contains a list of available marketplaces in reverse chronological order by billing + /// period. + internal partial interface IMarketplacesListResultInternal + + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The list of marketplaces. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/MarketplacesListResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplacesListResult.json.cs new file mode 100644 index 000000000000..b8c27e9ecf41 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MarketplacesListResult.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Result of listing marketplaces. It contains a list of available marketplaces in reverse chronological order by billing + /// period. + /// + public partial class MarketplacesListResult + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplacesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new MarketplacesListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal MarketplacesListResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IMarketplace) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Marketplace.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/MeterDetails.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetails.PowerShell.cs new file mode 100644 index 000000000000..d02cd5a2ffa0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetails.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the meter detail. + [System.ComponentModel.TypeConverter(typeof(MeterDetailsTypeConverter))] + public partial class MeterDetails + { + + /// + /// 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.Consumption.Models.Api20211001.IMeterDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MeterDetails(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.Consumption.Models.Api20211001.IMeterDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MeterDetails(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.Consumption.Models.Api20211001.IMeterDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MeterDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterName = (string) content.GetValueForProperty("MeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterCategory = (string) content.GetValueForProperty("MeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterSubCategory = (string) content.GetValueForProperty("MeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("MeterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterLocation = (string) content.GetValueForProperty("MeterLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterLocation, global::System.Convert.ToString); + } + if (content.Contains("TotalIncludedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).TotalIncludedQuantity = (decimal?) content.GetValueForProperty("TotalIncludedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).TotalIncludedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PretaxStandardRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).PretaxStandardRate = (decimal?) content.GetValueForProperty("PretaxStandardRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).PretaxStandardRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).ServiceName = (string) content.GetValueForProperty("ServiceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).ServiceName, global::System.Convert.ToString); + } + if (content.Contains("ServiceTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).ServiceTier = (string) content.GetValueForProperty("ServiceTier",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).ServiceTier, 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 MeterDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterName = (string) content.GetValueForProperty("MeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterCategory = (string) content.GetValueForProperty("MeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterSubCategory = (string) content.GetValueForProperty("MeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("MeterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterLocation = (string) content.GetValueForProperty("MeterLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).MeterLocation, global::System.Convert.ToString); + } + if (content.Contains("TotalIncludedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).TotalIncludedQuantity = (decimal?) content.GetValueForProperty("TotalIncludedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).TotalIncludedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PretaxStandardRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).PretaxStandardRate = (decimal?) content.GetValueForProperty("PretaxStandardRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).PretaxStandardRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).ServiceName = (string) content.GetValueForProperty("ServiceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).ServiceName, global::System.Convert.ToString); + } + if (content.Contains("ServiceTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).ServiceTier = (string) content.GetValueForProperty("ServiceTier",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)this).ServiceTier, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the meter detail. + [System.ComponentModel.TypeConverter(typeof(MeterDetailsTypeConverter))] + public partial interface IMeterDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetails.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetails.TypeConverter.cs new file mode 100644 index 000000000000..f5246198af6c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetails.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MeterDetailsTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IMeterDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MeterDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MeterDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MeterDetails.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/consumption/generated/api/Models/Api20211001/MeterDetails.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetails.cs new file mode 100644 index 000000000000..ab2c0a810fc6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetails.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the meter detail. + public partial class MeterDetails : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal + { + + /// Backing field for property. + private string _meterCategory; + + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterCategory { get => this._meterCategory; } + + /// Backing field for property. + private string _meterLocation; + + /// The location in which the Azure service is available. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterLocation { get => this._meterLocation; } + + /// Backing field for property. + private string _meterName; + + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterName { get => this._meterName; } + + /// Backing field for property. + private string _meterSubCategory; + + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterSubCategory { get => this._meterSubCategory; } + + /// Internal Acessors for MeterCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal.MeterCategory { get => this._meterCategory; set { {_meterCategory = value;} } } + + /// Internal Acessors for MeterLocation + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal.MeterLocation { get => this._meterLocation; set { {_meterLocation = value;} } } + + /// Internal Acessors for MeterName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal.MeterName { get => this._meterName; set { {_meterName = value;} } } + + /// Internal Acessors for MeterSubCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal.MeterSubCategory { get => this._meterSubCategory; set { {_meterSubCategory = value;} } } + + /// Internal Acessors for PretaxStandardRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal.PretaxStandardRate { get => this._pretaxStandardRate; set { {_pretaxStandardRate = value;} } } + + /// Internal Acessors for ServiceName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal.ServiceName { get => this._serviceName; set { {_serviceName = value;} } } + + /// Internal Acessors for ServiceTier + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal.ServiceTier { get => this._serviceTier; set { {_serviceTier = value;} } } + + /// Internal Acessors for TotalIncludedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal.TotalIncludedQuantity { get => this._totalIncludedQuantity; set { {_totalIncludedQuantity = value;} } } + + /// Internal Acessors for Unit + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal.Unit { get => this._unit; set { {_unit = value;} } } + + /// Backing field for property. + private decimal? _pretaxStandardRate; + + /// The pretax listing price. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? PretaxStandardRate { get => this._pretaxStandardRate; } + + /// Backing field for property. + private string _serviceName; + + /// The name of the service. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ServiceName { get => this._serviceName; } + + /// Backing field for property. + private string _serviceTier; + + /// The service tier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ServiceTier { get => this._serviceTier; } + + /// Backing field for property. + private decimal? _totalIncludedQuantity; + + /// The total included quantity associated with the offer. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? TotalIncludedQuantity { get => this._totalIncludedQuantity; } + + /// Backing field for property. + private string _unit; + + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Unit { get => this._unit; } + + /// Creates an new instance. + public MeterDetails() + { + + } + } + /// The properties of the meter detail. + public partial interface IMeterDetails : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The category of the meter, for example, 'Cloud services', 'Networking', etc..", + SerializedName = @"meterCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterCategory { get; } + /// The location in which the Azure service is available. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The location in which the Azure service is available.", + SerializedName = @"meterLocation", + PossibleTypes = new [] { typeof(string) })] + string MeterLocation { get; } + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the meter, within the given meter category", + SerializedName = @"meterName", + PossibleTypes = new [] { typeof(string) })] + string MeterName { get; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc..", + SerializedName = @"meterSubCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterSubCategory { get; } + /// The pretax listing price. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The pretax listing price.", + SerializedName = @"pretaxStandardRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PretaxStandardRate { get; } + /// The name of the service. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the service.", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + string ServiceName { get; } + /// The service tier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The service tier.", + SerializedName = @"serviceTier", + PossibleTypes = new [] { typeof(string) })] + string ServiceTier { get; } + /// The total included quantity associated with the offer. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total included quantity associated with the offer.", + SerializedName = @"totalIncludedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalIncludedQuantity { get; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string Unit { get; } + + } + /// The properties of the meter detail. + internal partial interface IMeterDetailsInternal + + { + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + string MeterCategory { get; set; } + /// The location in which the Azure service is available. + string MeterLocation { get; set; } + /// The name of the meter, within the given meter category + string MeterName { get; set; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + string MeterSubCategory { get; set; } + /// The pretax listing price. + decimal? PretaxStandardRate { get; set; } + /// The name of the service. + string ServiceName { get; set; } + /// The service tier. + string ServiceTier { get; set; } + /// The total included quantity associated with the offer. + decimal? TotalIncludedQuantity { get; set; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + string Unit { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetails.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetails.json.cs new file mode 100644 index 000000000000..8932510081d8 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetails.json.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the meter detail. + public partial class MeterDetails + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new MeterDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal MeterDetails(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_meterName = If( json?.PropertyT("meterName"), out var __jsonMeterName) ? (string)__jsonMeterName : (string)MeterName;} + {_meterCategory = If( json?.PropertyT("meterCategory"), out var __jsonMeterCategory) ? (string)__jsonMeterCategory : (string)MeterCategory;} + {_meterSubCategory = If( json?.PropertyT("meterSubCategory"), out var __jsonMeterSubCategory) ? (string)__jsonMeterSubCategory : (string)MeterSubCategory;} + {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} + {_meterLocation = If( json?.PropertyT("meterLocation"), out var __jsonMeterLocation) ? (string)__jsonMeterLocation : (string)MeterLocation;} + {_totalIncludedQuantity = If( json?.PropertyT("totalIncludedQuantity"), out var __jsonTotalIncludedQuantity) ? (decimal?)__jsonTotalIncludedQuantity : TotalIncludedQuantity;} + {_pretaxStandardRate = If( json?.PropertyT("pretaxStandardRate"), out var __jsonPretaxStandardRate) ? (decimal?)__jsonPretaxStandardRate : PretaxStandardRate;} + {_serviceName = If( json?.PropertyT("serviceName"), out var __jsonServiceName) ? (string)__jsonServiceName : (string)ServiceName;} + {_serviceTier = If( json?.PropertyT("serviceTier"), out var __jsonServiceTier) ? (string)__jsonServiceTier : (string)ServiceTier;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterName.ToString()) : null, "meterName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterCategory)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterCategory.ToString()) : null, "meterCategory" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterSubCategory)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterSubCategory.ToString()) : null, "meterSubCategory" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterLocation.ToString()) : null, "meterLocation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalIncludedQuantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._totalIncludedQuantity) : null, "totalIncludedQuantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._pretaxStandardRate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._pretaxStandardRate) : null, "pretaxStandardRate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serviceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._serviceName.ToString()) : null, "serviceName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serviceTier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._serviceTier.ToString()) : null, "serviceTier" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetailsResponse.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetailsResponse.PowerShell.cs new file mode 100644 index 000000000000..b02b1f9fb325 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetailsResponse.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the meter detail. + [System.ComponentModel.TypeConverter(typeof(MeterDetailsResponseTypeConverter))] + public partial class MeterDetailsResponse + { + + /// + /// 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.Consumption.Models.Api20211001.IMeterDetailsResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MeterDetailsResponse(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.Consumption.Models.Api20211001.IMeterDetailsResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MeterDetailsResponse(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.Consumption.Models.Api20211001.IMeterDetailsResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MeterDetailsResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).MeterName = (string) content.GetValueForProperty("MeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).MeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).MeterCategory = (string) content.GetValueForProperty("MeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).MeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).MeterSubCategory = (string) content.GetValueForProperty("MeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).MeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).UnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("ServiceFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).ServiceFamily = (string) content.GetValueForProperty("ServiceFamily",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).ServiceFamily, 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 MeterDetailsResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).MeterName = (string) content.GetValueForProperty("MeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).MeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).MeterCategory = (string) content.GetValueForProperty("MeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).MeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).MeterSubCategory = (string) content.GetValueForProperty("MeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).MeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).UnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("ServiceFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).ServiceFamily = (string) content.GetValueForProperty("ServiceFamily",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal)this).ServiceFamily, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the meter detail. + [System.ComponentModel.TypeConverter(typeof(MeterDetailsResponseTypeConverter))] + public partial interface IMeterDetailsResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetailsResponse.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetailsResponse.TypeConverter.cs new file mode 100644 index 000000000000..a02129a60f01 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetailsResponse.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MeterDetailsResponseTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IMeterDetailsResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MeterDetailsResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MeterDetailsResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MeterDetailsResponse.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/consumption/generated/api/Models/Api20211001/MeterDetailsResponse.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetailsResponse.cs new file mode 100644 index 000000000000..d9c25dab0a91 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetailsResponse.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the meter detail. + public partial class MeterDetailsResponse : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal + { + + /// Backing field for property. + private string _meterCategory; + + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterCategory { get => this._meterCategory; } + + /// Backing field for property. + private string _meterName; + + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterName { get => this._meterName; } + + /// Backing field for property. + private string _meterSubCategory; + + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterSubCategory { get => this._meterSubCategory; } + + /// Internal Acessors for MeterCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal.MeterCategory { get => this._meterCategory; set { {_meterCategory = value;} } } + + /// Internal Acessors for MeterName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal.MeterName { get => this._meterName; set { {_meterName = value;} } } + + /// Internal Acessors for MeterSubCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal.MeterSubCategory { get => this._meterSubCategory; set { {_meterSubCategory = value;} } } + + /// Internal Acessors for ServiceFamily + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal.ServiceFamily { get => this._serviceFamily; set { {_serviceFamily = value;} } } + + /// Internal Acessors for UnitOfMeasure + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponseInternal.UnitOfMeasure { get => this._unitOfMeasure; set { {_unitOfMeasure = value;} } } + + /// Backing field for property. + private string _serviceFamily; + + /// The service family. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ServiceFamily { get => this._serviceFamily; } + + /// Backing field for property. + private string _unitOfMeasure; + + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string UnitOfMeasure { get => this._unitOfMeasure; } + + /// Creates an new instance. + public MeterDetailsResponse() + { + + } + } + /// The properties of the meter detail. + public partial interface IMeterDetailsResponse : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The category of the meter, for example, 'Cloud services', 'Networking', etc..", + SerializedName = @"meterCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterCategory { get; } + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the meter, within the given meter category", + SerializedName = @"meterName", + PossibleTypes = new [] { typeof(string) })] + string MeterName { get; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc..", + SerializedName = @"meterSubCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterSubCategory { get; } + /// The service family. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The service family.", + SerializedName = @"serviceFamily", + PossibleTypes = new [] { typeof(string) })] + string ServiceFamily { get; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc.", + SerializedName = @"unitOfMeasure", + PossibleTypes = new [] { typeof(string) })] + string UnitOfMeasure { get; } + + } + /// The properties of the meter detail. + internal partial interface IMeterDetailsResponseInternal + + { + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + string MeterCategory { get; set; } + /// The name of the meter, within the given meter category + string MeterName { get; set; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + string MeterSubCategory { get; set; } + /// The service family. + string ServiceFamily { get; set; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + string UnitOfMeasure { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetailsResponse.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetailsResponse.json.cs new file mode 100644 index 000000000000..f5a3785146ba --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/MeterDetailsResponse.json.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the meter detail. + public partial class MeterDetailsResponse + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new MeterDetailsResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal MeterDetailsResponse(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_meterName = If( json?.PropertyT("meterName"), out var __jsonMeterName) ? (string)__jsonMeterName : (string)MeterName;} + {_meterCategory = If( json?.PropertyT("meterCategory"), out var __jsonMeterCategory) ? (string)__jsonMeterCategory : (string)MeterCategory;} + {_meterSubCategory = If( json?.PropertyT("meterSubCategory"), out var __jsonMeterSubCategory) ? (string)__jsonMeterSubCategory : (string)MeterSubCategory;} + {_unitOfMeasure = If( json?.PropertyT("unitOfMeasure"), out var __jsonUnitOfMeasure) ? (string)__jsonUnitOfMeasure : (string)UnitOfMeasure;} + {_serviceFamily = If( json?.PropertyT("serviceFamily"), out var __jsonServiceFamily) ? (string)__jsonServiceFamily : (string)ServiceFamily;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterName.ToString()) : null, "meterName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterCategory)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterCategory.ToString()) : null, "meterCategory" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterSubCategory)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterSubCategory.ToString()) : null, "meterSubCategory" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._unitOfMeasure)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._unitOfMeasure.ToString()) : null, "unitOfMeasure" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serviceFamily)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._serviceFamily.ToString()) : null, "serviceFamily" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummary.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummary.PowerShell.cs new file mode 100644 index 000000000000..bf7ee2dc2096 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummary.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Modern charge summary. + [System.ComponentModel.TypeConverter(typeof(ModernChargeSummaryTypeConverter))] + public partial class ModernChargeSummary + { + + /// + /// 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.Consumption.Models.Api20211001.IModernChargeSummary DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ModernChargeSummary(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.Consumption.Models.Api20211001.IModernChargeSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ModernChargeSummary(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.Consumption.Models.Api20211001.IModernChargeSummary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ModernChargeSummary(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.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernChargeSummaryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind.CreateFrom); + } + if (content.Contains("AzureCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).AzureCharge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("AzureCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).AzureCharge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).ChargesBilledSeparately = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).ChargesBilledSeparately, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("MarketplaceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).MarketplaceCharge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("MarketplaceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).MarketplaceCharge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).UsageStart = (string) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).UsageStart, global::System.Convert.ToString); + } + if (content.Contains("UsageEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).UsageEnd = (string) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).UsageEnd, global::System.Convert.ToString); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).InvoiceSectionId = (string) content.GetValueForProperty("InvoiceSectionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).InvoiceSectionId, global::System.Convert.ToString); + } + if (content.Contains("CustomerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).CustomerId = (string) content.GetValueForProperty("CustomerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).CustomerId, global::System.Convert.ToString); + } + if (content.Contains("IsInvoiced")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).IsInvoiced = (bool?) content.GetValueForProperty("IsInvoiced",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).IsInvoiced, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AzureChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).AzureChargeCurrency = (string) content.GetValueForProperty("AzureChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).AzureChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("AzureChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).AzureChargeValue = (decimal?) content.GetValueForProperty("AzureChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).AzureChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeBilledSeparatelyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).ChargeBilledSeparatelyCurrency = (string) content.GetValueForProperty("ChargeBilledSeparatelyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).ChargeBilledSeparatelyCurrency, global::System.Convert.ToString); + } + if (content.Contains("ChargeBilledSeparatelyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).ChargeBilledSeparatelyValue = (decimal?) content.GetValueForProperty("ChargeBilledSeparatelyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).ChargeBilledSeparatelyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MarketplaceChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).MarketplaceChargeCurrency = (string) content.GetValueForProperty("MarketplaceChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).MarketplaceChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("MarketplaceChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).MarketplaceChargeValue = (decimal?) content.GetValueForProperty("MarketplaceChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).MarketplaceChargeValue, (__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 ModernChargeSummary(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.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernChargeSummaryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind.CreateFrom); + } + if (content.Contains("AzureCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).AzureCharge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("AzureCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).AzureCharge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).ChargesBilledSeparately = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).ChargesBilledSeparately, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("MarketplaceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).MarketplaceCharge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("MarketplaceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).MarketplaceCharge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).UsageStart = (string) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).UsageStart, global::System.Convert.ToString); + } + if (content.Contains("UsageEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).UsageEnd = (string) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).UsageEnd, global::System.Convert.ToString); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).InvoiceSectionId = (string) content.GetValueForProperty("InvoiceSectionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).InvoiceSectionId, global::System.Convert.ToString); + } + if (content.Contains("CustomerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).CustomerId = (string) content.GetValueForProperty("CustomerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).CustomerId, global::System.Convert.ToString); + } + if (content.Contains("IsInvoiced")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).IsInvoiced = (bool?) content.GetValueForProperty("IsInvoiced",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).IsInvoiced, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AzureChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).AzureChargeCurrency = (string) content.GetValueForProperty("AzureChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).AzureChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("AzureChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).AzureChargeValue = (decimal?) content.GetValueForProperty("AzureChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).AzureChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeBilledSeparatelyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).ChargeBilledSeparatelyCurrency = (string) content.GetValueForProperty("ChargeBilledSeparatelyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).ChargeBilledSeparatelyCurrency, global::System.Convert.ToString); + } + if (content.Contains("ChargeBilledSeparatelyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).ChargeBilledSeparatelyValue = (decimal?) content.GetValueForProperty("ChargeBilledSeparatelyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).ChargeBilledSeparatelyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MarketplaceChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).MarketplaceChargeCurrency = (string) content.GetValueForProperty("MarketplaceChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).MarketplaceChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("MarketplaceChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).MarketplaceChargeValue = (decimal?) content.GetValueForProperty("MarketplaceChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal)this).MarketplaceChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Modern charge summary. + [System.ComponentModel.TypeConverter(typeof(ModernChargeSummaryTypeConverter))] + public partial interface IModernChargeSummary + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummary.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummary.TypeConverter.cs new file mode 100644 index 000000000000..2ac6266d2f2b --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummary.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ModernChargeSummaryTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IModernChargeSummary ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummary).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ModernChargeSummary.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ModernChargeSummary.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ModernChargeSummary.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/consumption/generated/api/Models/Api20211001/ModernChargeSummary.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummary.cs new file mode 100644 index 000000000000..88fa42c87d05 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummary.cs @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Modern charge summary. + public partial class ModernChargeSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummary, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary __chargeSummary = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ChargeSummary(); + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AzureChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).AzureChargeCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AzureChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).AzureChargeValue; } + + /// Billing Account Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).BillingAccountId; } + + /// The id of the billing period resource that the charge belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingPeriodId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).BillingPeriodId; } + + /// Billing Profile Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingProfileId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).BillingProfileId; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ChargeBilledSeparatelyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).ChargeBilledSeparatelyCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ChargeBilledSeparatelyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).ChargeBilledSeparatelyValue; } + + /// Customer Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CustomerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).CustomerId; } + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Etag; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Id; } + + /// Invoice Section Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InvoiceSectionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).InvoiceSectionId; } + + /// Is charge Invoiced + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public bool? IsInvoiced { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).IsInvoiced; } + + /// Specifies the kind of charge summary. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)__chargeSummary).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal)__chargeSummary).Kind = value ; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MarketplaceChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).MarketplaceChargeCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? MarketplaceChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).MarketplaceChargeValue; } + + /// Internal Acessors for AzureCharge + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.AzureCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).AzureCharge; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).AzureCharge = value; } + + /// Internal Acessors for AzureChargeCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.AzureChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).AzureChargeCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).AzureChargeCurrency = value; } + + /// Internal Acessors for AzureChargeValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.AzureChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).AzureChargeValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).AzureChargeValue = value; } + + /// Internal Acessors for BillingAccountId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.BillingAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).BillingAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).BillingAccountId = value; } + + /// Internal Acessors for BillingPeriodId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.BillingPeriodId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).BillingPeriodId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).BillingPeriodId = value; } + + /// Internal Acessors for BillingProfileId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.BillingProfileId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).BillingProfileId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).BillingProfileId = value; } + + /// Internal Acessors for ChargeBilledSeparatelyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.ChargeBilledSeparatelyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).ChargeBilledSeparatelyCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).ChargeBilledSeparatelyCurrency = value; } + + /// Internal Acessors for ChargeBilledSeparatelyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.ChargeBilledSeparatelyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).ChargeBilledSeparatelyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).ChargeBilledSeparatelyValue = value; } + + /// Internal Acessors for ChargesBilledSeparately + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.ChargesBilledSeparately { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).ChargesBilledSeparately; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).ChargesBilledSeparately = value; } + + /// Internal Acessors for CustomerId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.CustomerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).CustomerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).CustomerId = value; } + + /// Internal Acessors for InvoiceSectionId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.InvoiceSectionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).InvoiceSectionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).InvoiceSectionId = value; } + + /// Internal Acessors for IsInvoiced + bool? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.IsInvoiced { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).IsInvoiced; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).IsInvoiced = value; } + + /// Internal Acessors for MarketplaceCharge + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.MarketplaceCharge { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).MarketplaceCharge; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).MarketplaceCharge = value; } + + /// Internal Acessors for MarketplaceChargeCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.MarketplaceChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).MarketplaceChargeCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).MarketplaceChargeCurrency = value; } + + /// Internal Acessors for MarketplaceChargeValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.MarketplaceChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).MarketplaceChargeValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).MarketplaceChargeValue = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernChargeSummaryProperties()); set { {_property = value;} } } + + /// Internal Acessors for UsageEnd + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).UsageEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).UsageEnd = value; } + + /// Internal Acessors for UsageStart + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryInternal.UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).UsageStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).UsageStart = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryProperties _property; + + /// Properties for modern charge summary + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernChargeSummaryProperties()); set => this._property = value; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Tag; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__chargeSummary).Type; } + + /// Usage end date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).UsageEnd; } + + /// Usage start date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)Property).UsageStart; } + + /// Creates an new instance. + public ModernChargeSummary() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__chargeSummary), __chargeSummary); + await eventListener.AssertObjectIsValid(nameof(__chargeSummary), __chargeSummary); + } + } + /// Modern charge summary. + public partial interface IModernChargeSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary + { + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string AzureChargeCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AzureChargeValue { get; } + /// Billing Account Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Account Id", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + string BillingAccountId { get; } + /// The id of the billing period resource that the charge belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The id of the billing period resource that the charge belongs to.", + SerializedName = @"billingPeriodId", + PossibleTypes = new [] { typeof(string) })] + string BillingPeriodId { get; } + /// Billing Profile Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Profile Id", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileId { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ChargeBilledSeparatelyCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargeBilledSeparatelyValue { get; } + /// Customer Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Customer Id", + SerializedName = @"customerId", + PossibleTypes = new [] { typeof(string) })] + string CustomerId { get; } + /// Invoice Section Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice Section Id", + SerializedName = @"invoiceSectionId", + PossibleTypes = new [] { typeof(string) })] + string InvoiceSectionId { get; } + /// Is charge Invoiced + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Is charge Invoiced", + SerializedName = @"isInvoiced", + PossibleTypes = new [] { typeof(bool) })] + bool? IsInvoiced { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string MarketplaceChargeCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MarketplaceChargeValue { get; } + /// Usage end date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Usage end date.", + SerializedName = @"usageEnd", + PossibleTypes = new [] { typeof(string) })] + string UsageEnd { get; } + /// Usage start date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Usage start date.", + SerializedName = @"usageStart", + PossibleTypes = new [] { typeof(string) })] + string UsageStart { get; } + + } + /// Modern charge summary. + internal partial interface IModernChargeSummaryInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummaryInternal + { + /// Azure Charges. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount AzureCharge { get; set; } + /// Amount currency. + string AzureChargeCurrency { get; set; } + /// Amount. + decimal? AzureChargeValue { get; set; } + /// Billing Account Id + string BillingAccountId { get; set; } + /// The id of the billing period resource that the charge belongs to. + string BillingPeriodId { get; set; } + /// Billing Profile Id + string BillingProfileId { get; set; } + /// Amount currency. + string ChargeBilledSeparatelyCurrency { get; set; } + /// Amount. + decimal? ChargeBilledSeparatelyValue { get; set; } + /// Charges Billed separately. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount ChargesBilledSeparately { get; set; } + /// Customer Id + string CustomerId { get; set; } + /// Invoice Section Id + string InvoiceSectionId { get; set; } + /// Is charge Invoiced + bool? IsInvoiced { get; set; } + /// Marketplace Charges. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount MarketplaceCharge { get; set; } + /// Amount currency. + string MarketplaceChargeCurrency { get; set; } + /// Amount. + decimal? MarketplaceChargeValue { get; set; } + /// Properties for modern charge summary + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryProperties Property { get; set; } + /// Usage end date. + string UsageEnd { get; set; } + /// Usage start date. + string UsageStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummary.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummary.json.cs new file mode 100644 index 000000000000..55aea6469b3a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummary.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Modern charge summary. + public partial class ModernChargeSummary + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummary. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummary. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummary FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ModernChargeSummary(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ModernChargeSummary(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __chargeSummary = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ChargeSummary(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernChargeSummaryProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __chargeSummary?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ModernChargeSummaryProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummaryProperties.PowerShell.cs new file mode 100644 index 000000000000..a22b3f019747 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummaryProperties.PowerShell.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of modern charge summary. + [System.ComponentModel.TypeConverter(typeof(ModernChargeSummaryPropertiesTypeConverter))] + public partial class ModernChargeSummaryProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IModernChargeSummaryProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ModernChargeSummaryProperties(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.Consumption.Models.Api20211001.IModernChargeSummaryProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ModernChargeSummaryProperties(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.Consumption.Models.Api20211001.IModernChargeSummaryProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ModernChargeSummaryProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).AzureCharge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("AzureCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).AzureCharge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).ChargesBilledSeparately = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).ChargesBilledSeparately, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("MarketplaceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).MarketplaceCharge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("MarketplaceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).MarketplaceCharge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).UsageStart = (string) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).UsageStart, global::System.Convert.ToString); + } + if (content.Contains("UsageEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).UsageEnd = (string) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).UsageEnd, global::System.Convert.ToString); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).InvoiceSectionId = (string) content.GetValueForProperty("InvoiceSectionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).InvoiceSectionId, global::System.Convert.ToString); + } + if (content.Contains("CustomerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).CustomerId = (string) content.GetValueForProperty("CustomerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).CustomerId, global::System.Convert.ToString); + } + if (content.Contains("IsInvoiced")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).IsInvoiced = (bool?) content.GetValueForProperty("IsInvoiced",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).IsInvoiced, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AzureChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).AzureChargeCurrency = (string) content.GetValueForProperty("AzureChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).AzureChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("AzureChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).AzureChargeValue = (decimal?) content.GetValueForProperty("AzureChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).AzureChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeBilledSeparatelyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).ChargeBilledSeparatelyCurrency = (string) content.GetValueForProperty("ChargeBilledSeparatelyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).ChargeBilledSeparatelyCurrency, global::System.Convert.ToString); + } + if (content.Contains("ChargeBilledSeparatelyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).ChargeBilledSeparatelyValue = (decimal?) content.GetValueForProperty("ChargeBilledSeparatelyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).ChargeBilledSeparatelyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MarketplaceChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).MarketplaceChargeCurrency = (string) content.GetValueForProperty("MarketplaceChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).MarketplaceChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("MarketplaceChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).MarketplaceChargeValue = (decimal?) content.GetValueForProperty("MarketplaceChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).MarketplaceChargeValue, (__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 ModernChargeSummaryProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).AzureCharge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("AzureCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).AzureCharge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("ChargesBilledSeparately")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).ChargesBilledSeparately = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("ChargesBilledSeparately",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).ChargesBilledSeparately, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("MarketplaceCharge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).MarketplaceCharge = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("MarketplaceCharge",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).MarketplaceCharge, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).UsageStart = (string) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).UsageStart, global::System.Convert.ToString); + } + if (content.Contains("UsageEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).UsageEnd = (string) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).UsageEnd, global::System.Convert.ToString); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).InvoiceSectionId = (string) content.GetValueForProperty("InvoiceSectionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).InvoiceSectionId, global::System.Convert.ToString); + } + if (content.Contains("CustomerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).CustomerId = (string) content.GetValueForProperty("CustomerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).CustomerId, global::System.Convert.ToString); + } + if (content.Contains("IsInvoiced")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).IsInvoiced = (bool?) content.GetValueForProperty("IsInvoiced",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).IsInvoiced, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AzureChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).AzureChargeCurrency = (string) content.GetValueForProperty("AzureChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).AzureChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("AzureChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).AzureChargeValue = (decimal?) content.GetValueForProperty("AzureChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).AzureChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ChargeBilledSeparatelyCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).ChargeBilledSeparatelyCurrency = (string) content.GetValueForProperty("ChargeBilledSeparatelyCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).ChargeBilledSeparatelyCurrency, global::System.Convert.ToString); + } + if (content.Contains("ChargeBilledSeparatelyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).ChargeBilledSeparatelyValue = (decimal?) content.GetValueForProperty("ChargeBilledSeparatelyValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).ChargeBilledSeparatelyValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MarketplaceChargeCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).MarketplaceChargeCurrency = (string) content.GetValueForProperty("MarketplaceChargeCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).MarketplaceChargeCurrency, global::System.Convert.ToString); + } + if (content.Contains("MarketplaceChargeValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).MarketplaceChargeValue = (decimal?) content.GetValueForProperty("MarketplaceChargeValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal)this).MarketplaceChargeValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of modern charge summary. + [System.ComponentModel.TypeConverter(typeof(ModernChargeSummaryPropertiesTypeConverter))] + public partial interface IModernChargeSummaryProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummaryProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummaryProperties.TypeConverter.cs new file mode 100644 index 000000000000..58e655211358 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummaryProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ModernChargeSummaryPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IModernChargeSummaryProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ModernChargeSummaryProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ModernChargeSummaryProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ModernChargeSummaryProperties.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/consumption/generated/api/Models/Api20211001/ModernChargeSummaryProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummaryProperties.cs new file mode 100644 index 000000000000..c6dc1a0964cd --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummaryProperties.cs @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of modern charge summary. + public partial class ModernChargeSummaryProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _azureCharge; + + /// Azure Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount AzureCharge { get => (this._azureCharge = this._azureCharge ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AzureChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)AzureCharge).Currency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AzureChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)AzureCharge).Value; } + + /// Backing field for property. + private string _billingAccountId; + + /// Billing Account Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingAccountId { get => this._billingAccountId; } + + /// Backing field for property. + private string _billingPeriodId; + + /// The id of the billing period resource that the charge belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingPeriodId { get => this._billingPeriodId; } + + /// Backing field for property. + private string _billingProfileId; + + /// Billing Profile Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingProfileId { get => this._billingProfileId; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ChargeBilledSeparatelyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ChargesBilledSeparately).Currency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ChargeBilledSeparatelyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ChargesBilledSeparately).Value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _chargesBilledSeparately; + + /// Charges Billed separately. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount ChargesBilledSeparately { get => (this._chargesBilledSeparately = this._chargesBilledSeparately ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Backing field for property. + private string _customerId; + + /// Customer Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CustomerId { get => this._customerId; } + + /// Backing field for property. + private string _invoiceSectionId; + + /// Invoice Section Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InvoiceSectionId { get => this._invoiceSectionId; } + + /// Backing field for property. + private bool? _isInvoiced; + + /// Is charge Invoiced + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public bool? IsInvoiced { get => this._isInvoiced; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _marketplaceCharge; + + /// Marketplace Charges. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount MarketplaceCharge { get => (this._marketplaceCharge = this._marketplaceCharge ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MarketplaceChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)MarketplaceCharge).Currency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? MarketplaceChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)MarketplaceCharge).Value; } + + /// Internal Acessors for AzureCharge + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.AzureCharge { get => (this._azureCharge = this._azureCharge ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_azureCharge = value;} } } + + /// Internal Acessors for AzureChargeCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.AzureChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)AzureCharge).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)AzureCharge).Currency = value; } + + /// Internal Acessors for AzureChargeValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.AzureChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)AzureCharge).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)AzureCharge).Value = value; } + + /// Internal Acessors for BillingAccountId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.BillingAccountId { get => this._billingAccountId; set { {_billingAccountId = value;} } } + + /// Internal Acessors for BillingPeriodId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.BillingPeriodId { get => this._billingPeriodId; set { {_billingPeriodId = value;} } } + + /// Internal Acessors for BillingProfileId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.BillingProfileId { get => this._billingProfileId; set { {_billingProfileId = value;} } } + + /// Internal Acessors for ChargeBilledSeparatelyCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.ChargeBilledSeparatelyCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ChargesBilledSeparately).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ChargesBilledSeparately).Currency = value; } + + /// Internal Acessors for ChargeBilledSeparatelyValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.ChargeBilledSeparatelyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ChargesBilledSeparately).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)ChargesBilledSeparately).Value = value; } + + /// Internal Acessors for ChargesBilledSeparately + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.ChargesBilledSeparately { get => (this._chargesBilledSeparately = this._chargesBilledSeparately ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_chargesBilledSeparately = value;} } } + + /// Internal Acessors for CustomerId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.CustomerId { get => this._customerId; set { {_customerId = value;} } } + + /// Internal Acessors for InvoiceSectionId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.InvoiceSectionId { get => this._invoiceSectionId; set { {_invoiceSectionId = value;} } } + + /// Internal Acessors for IsInvoiced + bool? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.IsInvoiced { get => this._isInvoiced; set { {_isInvoiced = value;} } } + + /// Internal Acessors for MarketplaceCharge + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.MarketplaceCharge { get => (this._marketplaceCharge = this._marketplaceCharge ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_marketplaceCharge = value;} } } + + /// Internal Acessors for MarketplaceChargeCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.MarketplaceChargeCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)MarketplaceCharge).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)MarketplaceCharge).Currency = value; } + + /// Internal Acessors for MarketplaceChargeValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.MarketplaceChargeValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)MarketplaceCharge).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)MarketplaceCharge).Value = value; } + + /// Internal Acessors for UsageEnd + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.UsageEnd { get => this._usageEnd; set { {_usageEnd = value;} } } + + /// Internal Acessors for UsageStart + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryPropertiesInternal.UsageStart { get => this._usageStart; set { {_usageStart = value;} } } + + /// Backing field for property. + private string _usageEnd; + + /// Usage end date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string UsageEnd { get => this._usageEnd; } + + /// Backing field for property. + private string _usageStart; + + /// Usage start date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string UsageStart { get => this._usageStart; } + + /// Creates an new instance. + public ModernChargeSummaryProperties() + { + + } + } + /// The properties of modern charge summary. + public partial interface IModernChargeSummaryProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string AzureChargeCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AzureChargeValue { get; } + /// Billing Account Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Account Id", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + string BillingAccountId { get; } + /// The id of the billing period resource that the charge belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The id of the billing period resource that the charge belongs to.", + SerializedName = @"billingPeriodId", + PossibleTypes = new [] { typeof(string) })] + string BillingPeriodId { get; } + /// Billing Profile Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Profile Id", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileId { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string ChargeBilledSeparatelyCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ChargeBilledSeparatelyValue { get; } + /// Customer Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Customer Id", + SerializedName = @"customerId", + PossibleTypes = new [] { typeof(string) })] + string CustomerId { get; } + /// Invoice Section Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice Section Id", + SerializedName = @"invoiceSectionId", + PossibleTypes = new [] { typeof(string) })] + string InvoiceSectionId { get; } + /// Is charge Invoiced + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Is charge Invoiced", + SerializedName = @"isInvoiced", + PossibleTypes = new [] { typeof(bool) })] + bool? IsInvoiced { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string MarketplaceChargeCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MarketplaceChargeValue { get; } + /// Usage end date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Usage end date.", + SerializedName = @"usageEnd", + PossibleTypes = new [] { typeof(string) })] + string UsageEnd { get; } + /// Usage start date. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Usage start date.", + SerializedName = @"usageStart", + PossibleTypes = new [] { typeof(string) })] + string UsageStart { get; } + + } + /// The properties of modern charge summary. + internal partial interface IModernChargeSummaryPropertiesInternal + + { + /// Azure Charges. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount AzureCharge { get; set; } + /// Amount currency. + string AzureChargeCurrency { get; set; } + /// Amount. + decimal? AzureChargeValue { get; set; } + /// Billing Account Id + string BillingAccountId { get; set; } + /// The id of the billing period resource that the charge belongs to. + string BillingPeriodId { get; set; } + /// Billing Profile Id + string BillingProfileId { get; set; } + /// Amount currency. + string ChargeBilledSeparatelyCurrency { get; set; } + /// Amount. + decimal? ChargeBilledSeparatelyValue { get; set; } + /// Charges Billed separately. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount ChargesBilledSeparately { get; set; } + /// Customer Id + string CustomerId { get; set; } + /// Invoice Section Id + string InvoiceSectionId { get; set; } + /// Is charge Invoiced + bool? IsInvoiced { get; set; } + /// Marketplace Charges. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount MarketplaceCharge { get; set; } + /// Amount currency. + string MarketplaceChargeCurrency { get; set; } + /// Amount. + decimal? MarketplaceChargeValue { get; set; } + /// Usage end date. + string UsageEnd { get; set; } + /// Usage start date. + string UsageStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummaryProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummaryProperties.json.cs new file mode 100644 index 000000000000..91bbc1920dbb --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernChargeSummaryProperties.json.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of modern charge summary. + public partial class ModernChargeSummaryProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernChargeSummaryProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ModernChargeSummaryProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ModernChargeSummaryProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_azureCharge = If( json?.PropertyT("azureCharges"), out var __jsonAzureCharges) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonAzureCharges) : AzureCharge;} + {_chargesBilledSeparately = If( json?.PropertyT("chargesBilledSeparately"), out var __jsonChargesBilledSeparately) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonChargesBilledSeparately) : ChargesBilledSeparately;} + {_marketplaceCharge = If( json?.PropertyT("marketplaceCharges"), out var __jsonMarketplaceCharges) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonMarketplaceCharges) : MarketplaceCharge;} + {_billingPeriodId = If( json?.PropertyT("billingPeriodId"), out var __jsonBillingPeriodId) ? (string)__jsonBillingPeriodId : (string)BillingPeriodId;} + {_usageStart = If( json?.PropertyT("usageStart"), out var __jsonUsageStart) ? (string)__jsonUsageStart : (string)UsageStart;} + {_usageEnd = If( json?.PropertyT("usageEnd"), out var __jsonUsageEnd) ? (string)__jsonUsageEnd : (string)UsageEnd;} + {_billingAccountId = If( json?.PropertyT("billingAccountId"), out var __jsonBillingAccountId) ? (string)__jsonBillingAccountId : (string)BillingAccountId;} + {_billingProfileId = If( json?.PropertyT("billingProfileId"), out var __jsonBillingProfileId) ? (string)__jsonBillingProfileId : (string)BillingProfileId;} + {_invoiceSectionId = If( json?.PropertyT("invoiceSectionId"), out var __jsonInvoiceSectionId) ? (string)__jsonInvoiceSectionId : (string)InvoiceSectionId;} + {_customerId = If( json?.PropertyT("customerId"), out var __jsonCustomerId) ? (string)__jsonCustomerId : (string)CustomerId;} + {_isInvoiced = If( json?.PropertyT("isInvoiced"), out var __jsonIsInvoiced) ? (bool?)__jsonIsInvoiced : IsInvoiced;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._azureCharge ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._azureCharge.ToJson(null,serializationMode) : null, "azureCharges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._chargesBilledSeparately ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._chargesBilledSeparately.ToJson(null,serializationMode) : null, "chargesBilledSeparately" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._marketplaceCharge ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._marketplaceCharge.ToJson(null,serializationMode) : null, "marketplaceCharges" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingPeriodId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingPeriodId.ToString()) : null, "billingPeriodId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._usageStart)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._usageStart.ToString()) : null, "usageStart" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._usageEnd)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._usageEnd.ToString()) : null, "usageEnd" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingAccountId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingAccountId.ToString()) : null, "billingAccountId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingProfileId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingProfileId.ToString()) : null, "billingProfileId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._invoiceSectionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._invoiceSectionId.ToString()) : null, "invoiceSectionId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._customerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._customerId.ToString()) : null, "customerId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isInvoiced ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonBoolean((bool)this._isInvoiced) : null, "isInvoiced" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendation.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendation.PowerShell.cs new file mode 100644 index 000000000000..0531f93e77db --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendation.PowerShell.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Modern reservation recommendation. + [System.ComponentModel.TypeConverter(typeof(ModernReservationRecommendationTypeConverter))] + public partial class ModernReservationRecommendation + { + + /// + /// 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.Consumption.Models.Api20211001.IModernReservationRecommendation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ModernReservationRecommendation(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.Consumption.Models.Api20211001.IModernReservationRecommendation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ModernReservationRecommendation(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.Consumption.Models.Api20211001.IModernReservationRecommendation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ModernReservationRecommendation(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.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind.CreateFrom); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).CostWithNoReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).CostWithNoReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).TotalCostWithReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).TotalCostWithReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NetSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NetSaving, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).PropertiesLocation = (string) content.GetValueForProperty("PropertiesLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).PropertiesLocation, global::System.Convert.ToString); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).LookBackPeriod = (int?) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).LookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).CostWithNoReservedInstanceCurrency = (string) content.GetValueForProperty("CostWithNoReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).CostWithNoReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).CostWithNoReservedInstanceValue = (decimal?) content.GetValueForProperty("CostWithNoReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).CostWithNoReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).TotalCostWithReservedInstanceCurrency = (string) content.GetValueForProperty("TotalCostWithReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).TotalCostWithReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("TotalCostWithReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).TotalCostWithReservedInstanceValue = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).TotalCostWithReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSavingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NetSavingCurrency = (string) content.GetValueForProperty("NetSavingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NetSavingCurrency, global::System.Convert.ToString); + } + if (content.Contains("NetSavingValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NetSavingValue = (decimal?) content.GetValueForProperty("NetSavingValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NetSavingValue, (__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 ModernReservationRecommendation(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.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind.CreateFrom); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).CostWithNoReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).CostWithNoReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).TotalCostWithReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).TotalCostWithReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NetSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NetSaving, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).PropertiesLocation = (string) content.GetValueForProperty("PropertiesLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).PropertiesLocation, global::System.Convert.ToString); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).LookBackPeriod = (int?) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).LookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).CostWithNoReservedInstanceCurrency = (string) content.GetValueForProperty("CostWithNoReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).CostWithNoReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).CostWithNoReservedInstanceValue = (decimal?) content.GetValueForProperty("CostWithNoReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).CostWithNoReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).TotalCostWithReservedInstanceCurrency = (string) content.GetValueForProperty("TotalCostWithReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).TotalCostWithReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("TotalCostWithReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).TotalCostWithReservedInstanceValue = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).TotalCostWithReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSavingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NetSavingCurrency = (string) content.GetValueForProperty("NetSavingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NetSavingCurrency, global::System.Convert.ToString); + } + if (content.Contains("NetSavingValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NetSavingValue = (decimal?) content.GetValueForProperty("NetSavingValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal)this).NetSavingValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Modern reservation recommendation. + [System.ComponentModel.TypeConverter(typeof(ModernReservationRecommendationTypeConverter))] + public partial interface IModernReservationRecommendation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendation.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendation.TypeConverter.cs new file mode 100644 index 000000000000..783cafb7b063 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendation.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ModernReservationRecommendationTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IModernReservationRecommendation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ModernReservationRecommendation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ModernReservationRecommendation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ModernReservationRecommendation.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/consumption/generated/api/Models/Api20211001/ModernReservationRecommendation.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendation.cs new file mode 100644 index 000000000000..71593e111d00 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendation.cs @@ -0,0 +1,470 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Modern reservation recommendation. + public partial class ModernReservationRecommendation : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendation, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation __reservationRecommendation = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendation(); + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CostWithNoReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).CostWithNoReservedInstanceCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CostWithNoReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).CostWithNoReservedInstanceValue; } + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Etag; } + + /// The usage date for looking back. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? FirstUsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).FirstUsageDate; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Id; } + + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).InstanceFlexibilityGroup; } + + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public float? InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).InstanceFlexibilityRatio; } + + /// Specifies the kind of reservation recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)__reservationRecommendation).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)__reservationRecommendation).Kind = value ; } + + /// Resource location + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__reservationRecommendation).Location; } + + /// The number of days of usage to look back for recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? LookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).LookBackPeriod; } + + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).MeterId; } + + /// Internal Acessors for CostWithNoReservedInstance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.CostWithNoReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).CostWithNoReservedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).CostWithNoReservedInstance = value; } + + /// Internal Acessors for CostWithNoReservedInstanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.CostWithNoReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).CostWithNoReservedInstanceCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).CostWithNoReservedInstanceCurrency = value; } + + /// Internal Acessors for CostWithNoReservedInstanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.CostWithNoReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).CostWithNoReservedInstanceValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).CostWithNoReservedInstanceValue = value; } + + /// Internal Acessors for FirstUsageDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.FirstUsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).FirstUsageDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).FirstUsageDate = value; } + + /// Internal Acessors for InstanceFlexibilityGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).InstanceFlexibilityGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).InstanceFlexibilityGroup = value; } + + /// Internal Acessors for InstanceFlexibilityRatio + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).InstanceFlexibilityRatio; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).InstanceFlexibilityRatio = value; } + + /// Internal Acessors for LookBackPeriod + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.LookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).LookBackPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).LookBackPeriod = value; } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).MeterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).MeterId = value; } + + /// Internal Acessors for NetSaving + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.NetSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).NetSaving; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).NetSaving = value; } + + /// Internal Acessors for NetSavingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.NetSavingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).NetSavingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).NetSavingCurrency = value; } + + /// Internal Acessors for NetSavingValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.NetSavingValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).NetSavingValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).NetSavingValue = value; } + + /// Internal Acessors for NormalizedSize + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.NormalizedSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).NormalizedSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).NormalizedSize = value; } + + /// Internal Acessors for PropertiesLocation + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.PropertiesLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).Location = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendationProperties()); set { {_property = value;} } } + + /// Internal Acessors for RecommendedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.RecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).RecommendedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).RecommendedQuantity = value; } + + /// Internal Acessors for RecommendedQuantityNormalized + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.RecommendedQuantityNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).RecommendedQuantityNormalized; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).RecommendedQuantityNormalized = value; } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).ResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).ResourceType = value; } + + /// Internal Acessors for SkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).SkuName = value; } + + /// Internal Acessors for SkuProperty + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.SkuProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).SkuProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).SkuProperty = value; } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).Term = value; } + + /// Internal Acessors for TotalCostWithReservedInstance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.TotalCostWithReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).TotalCostWithReservedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).TotalCostWithReservedInstance = value; } + + /// Internal Acessors for TotalCostWithReservedInstanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.TotalCostWithReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).TotalCostWithReservedInstanceCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).TotalCostWithReservedInstanceCurrency = value; } + + /// Internal Acessors for TotalCostWithReservedInstanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationInternal.TotalCostWithReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).TotalCostWithReservedInstanceValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).TotalCostWithReservedInstanceValue = value; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__reservationRecommendation).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__reservationRecommendation).Location = value; } + + /// Internal Acessors for Sku + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__reservationRecommendation).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__reservationRecommendation).Sku = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Name; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string NetSavingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).NetSavingCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? NetSavingValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).NetSavingValue; } + + /// The normalized Size. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string NormalizedSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).NormalizedSize; } + + /// Resource Location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PropertiesLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).Location; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties _property; + + /// Properties for modern reservation recommendation + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendationProperties()); set => this._property = value; } + + /// Recommended quality for reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? RecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).RecommendedQuantity; } + + /// The recommended Quantity Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public float? RecommendedQuantityNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).RecommendedQuantityNormalized; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).ResourceType; } + + /// Shared or single recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).Scope = value ; } + + /// Resource sku + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__reservationRecommendation).Sku; } + + /// This is the ARM Sku name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).SkuName; } + + /// List of sku properties + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).SkuProperty; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Tag; } + + /// RI recommendations in one or three year terms. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).Term; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string TotalCostWithReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).TotalCostWithReservedInstanceCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? TotalCostWithReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)Property).TotalCostWithReservedInstanceValue; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__reservationRecommendation).Type; } + + /// Creates an new instance. + public ModernReservationRecommendation() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__reservationRecommendation), __reservationRecommendation); + await eventListener.AssertObjectIsValid(nameof(__reservationRecommendation), __reservationRecommendation); + } + } + /// Modern reservation recommendation. + public partial interface IModernReservationRecommendation : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation + { + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string CostWithNoReservedInstanceCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CostWithNoReservedInstanceValue { get; } + /// The usage date for looking back. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The usage date for looking back.", + SerializedName = @"firstUsageDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FirstUsageDate { get; } + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instance Flexibility Group.", + SerializedName = @"instanceFlexibilityGroup", + PossibleTypes = new [] { typeof(string) })] + string InstanceFlexibilityGroup { get; } + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instance Flexibility Ratio.", + SerializedName = @"instanceFlexibilityRatio", + PossibleTypes = new [] { typeof(float) })] + float? InstanceFlexibilityRatio { get; } + /// The number of days of usage to look back for recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The number of days of usage to look back for recommendation.", + SerializedName = @"lookBackPeriod", + PossibleTypes = new [] { typeof(int) })] + int? LookBackPeriod { get; } + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter id (GUID)", + SerializedName = @"meterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string NetSavingCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? NetSavingValue { get; } + /// The normalized Size. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The normalized Size.", + SerializedName = @"normalizedSize", + PossibleTypes = new [] { typeof(string) })] + string NormalizedSize { get; } + /// Resource Location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string PropertiesLocation { get; } + /// Recommended quality for reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Recommended quality for reserved instances.", + SerializedName = @"recommendedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? RecommendedQuantity { get; } + /// The recommended Quantity Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The recommended Quantity Normalized.", + SerializedName = @"recommendedQuantityNormalized", + PossibleTypes = new [] { typeof(float) })] + float? RecommendedQuantityNormalized { get; } + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource type.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; } + /// Shared or single recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Shared or single recommendation.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// This is the ARM Sku name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the ARM Sku name.", + SerializedName = @"skuName", + PossibleTypes = new [] { typeof(string) })] + string SkuName { get; } + /// List of sku properties + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of sku properties", + SerializedName = @"skuProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get; } + /// RI recommendations in one or three year terms. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"RI recommendations in one or three year terms.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(string) })] + string Term { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string TotalCostWithReservedInstanceCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalCostWithReservedInstanceValue { get; } + + } + /// Modern reservation recommendation. + internal partial interface IModernReservationRecommendationInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal + { + /// The total amount of cost without reserved instances. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CostWithNoReservedInstance { get; set; } + /// Amount currency. + string CostWithNoReservedInstanceCurrency { get; set; } + /// Amount. + decimal? CostWithNoReservedInstanceValue { get; set; } + /// The usage date for looking back. + global::System.DateTime? FirstUsageDate { get; set; } + /// The instance Flexibility Group. + string InstanceFlexibilityGroup { get; set; } + /// The instance Flexibility Ratio. + float? InstanceFlexibilityRatio { get; set; } + /// The number of days of usage to look back for recommendation. + int? LookBackPeriod { get; set; } + /// The meter id (GUID) + string MeterId { get; set; } + /// Total estimated savings with reserved instances. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount NetSaving { get; set; } + /// Amount currency. + string NetSavingCurrency { get; set; } + /// Amount. + decimal? NetSavingValue { get; set; } + /// The normalized Size. + string NormalizedSize { get; set; } + /// Resource Location. + string PropertiesLocation { get; set; } + /// Properties for modern reservation recommendation + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties Property { get; set; } + /// Recommended quality for reserved instances. + decimal? RecommendedQuantity { get; set; } + /// The recommended Quantity Normalized. + float? RecommendedQuantityNormalized { get; set; } + /// Resource type. + string ResourceType { get; set; } + /// Shared or single recommendation. + string Scope { get; set; } + /// This is the ARM Sku name. + string SkuName { get; set; } + /// List of sku properties + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get; set; } + /// RI recommendations in one or three year terms. + string Term { get; set; } + /// The total amount of cost with reserved instances. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount TotalCostWithReservedInstance { get; set; } + /// Amount currency. + string TotalCostWithReservedInstanceCurrency { get; set; } + /// Amount. + decimal? TotalCostWithReservedInstanceValue { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendation.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendation.json.cs new file mode 100644 index 000000000000..86e41a486c6b --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendation.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Modern reservation recommendation. + public partial class ModernReservationRecommendation + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ModernReservationRecommendation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ModernReservationRecommendation(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __reservationRecommendation = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendation(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendationProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __reservationRecommendation?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ModernReservationRecommendationProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendationProperties.PowerShell.cs new file mode 100644 index 000000000000..8fd1cd723169 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendationProperties.PowerShell.cs @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the reservation recommendation. + [System.ComponentModel.TypeConverter(typeof(ModernReservationRecommendationPropertiesTypeConverter))] + public partial class ModernReservationRecommendationProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IModernReservationRecommendationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ModernReservationRecommendationProperties(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.Consumption.Models.Api20211001.IModernReservationRecommendationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ModernReservationRecommendationProperties(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.Consumption.Models.Api20211001.IModernReservationRecommendationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ModernReservationRecommendationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSaving, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).LookBackPeriod = (int?) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).LookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceCurrency = (string) content.GetValueForProperty("CostWithNoReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceValue = (decimal?) content.GetValueForProperty("CostWithNoReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceCurrency = (string) content.GetValueForProperty("TotalCostWithReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("TotalCostWithReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceValue = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSavingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingCurrency = (string) content.GetValueForProperty("NetSavingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingCurrency, global::System.Convert.ToString); + } + if (content.Contains("NetSavingValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingValue = (decimal?) content.GetValueForProperty("NetSavingValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingValue, (__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 ModernReservationRecommendationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSaving, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).LookBackPeriod = (int?) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).LookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceCurrency = (string) content.GetValueForProperty("CostWithNoReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceValue = (decimal?) content.GetValueForProperty("CostWithNoReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceCurrency = (string) content.GetValueForProperty("TotalCostWithReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("TotalCostWithReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceValue = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSavingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingCurrency = (string) content.GetValueForProperty("NetSavingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingCurrency, global::System.Convert.ToString); + } + if (content.Contains("NetSavingValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingValue = (decimal?) content.GetValueForProperty("NetSavingValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the reservation recommendation. + [System.ComponentModel.TypeConverter(typeof(ModernReservationRecommendationPropertiesTypeConverter))] + public partial interface IModernReservationRecommendationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendationProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendationProperties.TypeConverter.cs new file mode 100644 index 000000000000..815c97486939 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendationProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ModernReservationRecommendationPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IModernReservationRecommendationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ModernReservationRecommendationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ModernReservationRecommendationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ModernReservationRecommendationProperties.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/consumption/generated/api/Models/Api20211001/ModernReservationRecommendationProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendationProperties.cs new file mode 100644 index 000000000000..b45e0f10be25 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendationProperties.cs @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the reservation recommendation. + public partial class ModernReservationRecommendationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _costWithNoReservedInstance; + + /// The total amount of cost without reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CostWithNoReservedInstance { get => (this._costWithNoReservedInstance = this._costWithNoReservedInstance ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CostWithNoReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CostWithNoReservedInstance).Currency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CostWithNoReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CostWithNoReservedInstance).Value; } + + /// Backing field for property. + private global::System.DateTime? _firstUsageDate; + + /// The usage date for looking back. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? FirstUsageDate { get => this._firstUsageDate; } + + /// Backing field for property. + private string _instanceFlexibilityGroup; + + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InstanceFlexibilityGroup { get => this._instanceFlexibilityGroup; } + + /// Backing field for property. + private float? _instanceFlexibilityRatio; + + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? InstanceFlexibilityRatio { get => this._instanceFlexibilityRatio; } + + /// Backing field for property. + private string _location; + + /// Resource Location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Location { get => this._location; } + + /// Backing field for property. + private int? _lookBackPeriod; + + /// The number of days of usage to look back for recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public int? LookBackPeriod { get => this._lookBackPeriod; } + + /// Backing field for property. + private string _meterId; + + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterId { get => this._meterId; } + + /// Internal Acessors for CostWithNoReservedInstance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.CostWithNoReservedInstance { get => (this._costWithNoReservedInstance = this._costWithNoReservedInstance ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_costWithNoReservedInstance = value;} } } + + /// Internal Acessors for CostWithNoReservedInstanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.CostWithNoReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CostWithNoReservedInstance).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CostWithNoReservedInstance).Currency = value; } + + /// Internal Acessors for CostWithNoReservedInstanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.CostWithNoReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CostWithNoReservedInstance).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)CostWithNoReservedInstance).Value = value; } + + /// Internal Acessors for FirstUsageDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.FirstUsageDate { get => this._firstUsageDate; set { {_firstUsageDate = value;} } } + + /// Internal Acessors for InstanceFlexibilityGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.InstanceFlexibilityGroup { get => this._instanceFlexibilityGroup; set { {_instanceFlexibilityGroup = value;} } } + + /// Internal Acessors for InstanceFlexibilityRatio + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.InstanceFlexibilityRatio { get => this._instanceFlexibilityRatio; set { {_instanceFlexibilityRatio = value;} } } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for LookBackPeriod + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.LookBackPeriod { get => this._lookBackPeriod; set { {_lookBackPeriod = value;} } } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.MeterId { get => this._meterId; set { {_meterId = value;} } } + + /// Internal Acessors for NetSaving + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.NetSaving { get => (this._netSaving = this._netSaving ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_netSaving = value;} } } + + /// Internal Acessors for NetSavingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.NetSavingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NetSaving).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NetSaving).Currency = value; } + + /// Internal Acessors for NetSavingValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.NetSavingValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NetSaving).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NetSaving).Value = value; } + + /// Internal Acessors for NormalizedSize + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.NormalizedSize { get => this._normalizedSize; set { {_normalizedSize = value;} } } + + /// Internal Acessors for RecommendedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.RecommendedQuantity { get => this._recommendedQuantity; set { {_recommendedQuantity = value;} } } + + /// Internal Acessors for RecommendedQuantityNormalized + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.RecommendedQuantityNormalized { get => this._recommendedQuantityNormalized; set { {_recommendedQuantityNormalized = value;} } } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.ResourceType { get => this._resourceType; set { {_resourceType = value;} } } + + /// Internal Acessors for SkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.SkuName { get => this._skuName; set { {_skuName = value;} } } + + /// Internal Acessors for SkuProperty + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.SkuProperty { get => this._skuProperty; set { {_skuProperty = value;} } } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.Term { get => this._term; set { {_term = value;} } } + + /// Internal Acessors for TotalCostWithReservedInstance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.TotalCostWithReservedInstance { get => (this._totalCostWithReservedInstance = this._totalCostWithReservedInstance ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); set { {_totalCostWithReservedInstance = value;} } } + + /// Internal Acessors for TotalCostWithReservedInstanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.TotalCostWithReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)TotalCostWithReservedInstance).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)TotalCostWithReservedInstance).Currency = value; } + + /// Internal Acessors for TotalCostWithReservedInstanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.TotalCostWithReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)TotalCostWithReservedInstance).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)TotalCostWithReservedInstance).Value = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _netSaving; + + /// Total estimated savings with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount NetSaving { get => (this._netSaving = this._netSaving ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string NetSavingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NetSaving).Currency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? NetSavingValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)NetSaving).Value; } + + /// Backing field for property. + private string _normalizedSize; + + /// The normalized Size. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NormalizedSize { get => this._normalizedSize; } + + /// Backing field for property. + private decimal? _recommendedQuantity; + + /// Recommended quality for reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? RecommendedQuantity { get => this._recommendedQuantity; } + + /// Backing field for property. + private float? _recommendedQuantityNormalized; + + /// The recommended Quantity Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? RecommendedQuantityNormalized { get => this._recommendedQuantityNormalized; } + + /// Backing field for property. + private string _resourceType; + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceType { get => this._resourceType; } + + /// Backing field for property. + private string _scope; + + /// Shared or single recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private string _skuName; + + /// This is the ARM Sku name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SkuName { get => this._skuName; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] _skuProperty; + + /// List of sku properties + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get => this._skuProperty; } + + /// Backing field for property. + private string _term; + + /// RI recommendations in one or three year terms. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Term { get => this._term; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount _totalCostWithReservedInstance; + + /// The total amount of cost with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount TotalCostWithReservedInstance { get => (this._totalCostWithReservedInstance = this._totalCostWithReservedInstance ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount()); } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string TotalCostWithReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)TotalCostWithReservedInstance).Currency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? TotalCostWithReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmountInternal)TotalCostWithReservedInstance).Value; } + + /// + /// Creates an new instance. + /// + public ModernReservationRecommendationProperties() + { + + } + } + /// The properties of the reservation recommendation. + public partial interface IModernReservationRecommendationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string CostWithNoReservedInstanceCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CostWithNoReservedInstanceValue { get; } + /// The usage date for looking back. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The usage date for looking back.", + SerializedName = @"firstUsageDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FirstUsageDate { get; } + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instance Flexibility Group.", + SerializedName = @"instanceFlexibilityGroup", + PossibleTypes = new [] { typeof(string) })] + string InstanceFlexibilityGroup { get; } + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instance Flexibility Ratio.", + SerializedName = @"instanceFlexibilityRatio", + PossibleTypes = new [] { typeof(float) })] + float? InstanceFlexibilityRatio { get; } + /// Resource Location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; } + /// The number of days of usage to look back for recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The number of days of usage to look back for recommendation.", + SerializedName = @"lookBackPeriod", + PossibleTypes = new [] { typeof(int) })] + int? LookBackPeriod { get; } + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter id (GUID)", + SerializedName = @"meterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string NetSavingCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? NetSavingValue { get; } + /// The normalized Size. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The normalized Size.", + SerializedName = @"normalizedSize", + PossibleTypes = new [] { typeof(string) })] + string NormalizedSize { get; } + /// Recommended quality for reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Recommended quality for reserved instances.", + SerializedName = @"recommendedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? RecommendedQuantity { get; } + /// The recommended Quantity Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The recommended Quantity Normalized.", + SerializedName = @"recommendedQuantityNormalized", + PossibleTypes = new [] { typeof(float) })] + float? RecommendedQuantityNormalized { get; } + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource type.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; } + /// Shared or single recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Shared or single recommendation.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// This is the ARM Sku name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the ARM Sku name.", + SerializedName = @"skuName", + PossibleTypes = new [] { typeof(string) })] + string SkuName { get; } + /// List of sku properties + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of sku properties", + SerializedName = @"skuProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get; } + /// RI recommendations in one or three year terms. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"RI recommendations in one or three year terms.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(string) })] + string Term { get; } + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount currency.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string TotalCostWithReservedInstanceCurrency { get; } + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Amount.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalCostWithReservedInstanceValue { get; } + + } + /// The properties of the reservation recommendation. + internal partial interface IModernReservationRecommendationPropertiesInternal + + { + /// The total amount of cost without reserved instances. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CostWithNoReservedInstance { get; set; } + /// Amount currency. + string CostWithNoReservedInstanceCurrency { get; set; } + /// Amount. + decimal? CostWithNoReservedInstanceValue { get; set; } + /// The usage date for looking back. + global::System.DateTime? FirstUsageDate { get; set; } + /// The instance Flexibility Group. + string InstanceFlexibilityGroup { get; set; } + /// The instance Flexibility Ratio. + float? InstanceFlexibilityRatio { get; set; } + /// Resource Location. + string Location { get; set; } + /// The number of days of usage to look back for recommendation. + int? LookBackPeriod { get; set; } + /// The meter id (GUID) + string MeterId { get; set; } + /// Total estimated savings with reserved instances. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount NetSaving { get; set; } + /// Amount currency. + string NetSavingCurrency { get; set; } + /// Amount. + decimal? NetSavingValue { get; set; } + /// The normalized Size. + string NormalizedSize { get; set; } + /// Recommended quality for reserved instances. + decimal? RecommendedQuantity { get; set; } + /// The recommended Quantity Normalized. + float? RecommendedQuantityNormalized { get; set; } + /// Resource type. + string ResourceType { get; set; } + /// Shared or single recommendation. + string Scope { get; set; } + /// This is the ARM Sku name. + string SkuName { get; set; } + /// List of sku properties + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get; set; } + /// RI recommendations in one or three year terms. + string Term { get; set; } + /// The total amount of cost with reserved instances. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount TotalCostWithReservedInstance { get; set; } + /// Amount currency. + string TotalCostWithReservedInstanceCurrency { get; set; } + /// Amount. + decimal? TotalCostWithReservedInstanceValue { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendationProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendationProperties.json.cs new file mode 100644 index 000000000000..84617973ffba --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationRecommendationProperties.json.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the reservation recommendation. + public partial class ModernReservationRecommendationProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties + /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the + /// payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("scope") ) + { + case "Single": + { + return new ModernSingleScopeReservationRecommendationProperties(json); + } + case "Shared": + { + return new ModernSharedScopeReservationRecommendationProperties(json); + } + } + return new ModernReservationRecommendationProperties(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ModernReservationRecommendationProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_costWithNoReservedInstance = If( json?.PropertyT("costWithNoReservedInstances"), out var __jsonCostWithNoReservedInstances) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonCostWithNoReservedInstances) : CostWithNoReservedInstance;} + {_totalCostWithReservedInstance = If( json?.PropertyT("totalCostWithReservedInstances"), out var __jsonTotalCostWithReservedInstances) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonTotalCostWithReservedInstances) : TotalCostWithReservedInstance;} + {_netSaving = If( json?.PropertyT("netSavings"), out var __jsonNetSavings) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Amount.FromJson(__jsonNetSavings) : NetSaving;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_lookBackPeriod = If( json?.PropertyT("lookBackPeriod"), out var __jsonLookBackPeriod) ? (int?)__jsonLookBackPeriod : LookBackPeriod;} + {_instanceFlexibilityRatio = If( json?.PropertyT("instanceFlexibilityRatio"), out var __jsonInstanceFlexibilityRatio) ? (float?)__jsonInstanceFlexibilityRatio : InstanceFlexibilityRatio;} + {_instanceFlexibilityGroup = If( json?.PropertyT("instanceFlexibilityGroup"), out var __jsonInstanceFlexibilityGroup) ? (string)__jsonInstanceFlexibilityGroup : (string)InstanceFlexibilityGroup;} + {_normalizedSize = If( json?.PropertyT("normalizedSize"), out var __jsonNormalizedSize) ? (string)__jsonNormalizedSize : (string)NormalizedSize;} + {_recommendedQuantityNormalized = If( json?.PropertyT("recommendedQuantityNormalized"), out var __jsonRecommendedQuantityNormalized) ? (float?)__jsonRecommendedQuantityNormalized : RecommendedQuantityNormalized;} + {_meterId = If( json?.PropertyT("meterId"), out var __jsonMeterId) ? (string)__jsonMeterId : (string)MeterId;} + {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)Term;} + {_recommendedQuantity = If( json?.PropertyT("recommendedQuantity"), out var __jsonRecommendedQuantity) ? (decimal?)__jsonRecommendedQuantity : RecommendedQuantity;} + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + {_firstUsageDate = If( json?.PropertyT("firstUsageDate"), out var __jsonFirstUsageDate) ? global::System.DateTime.TryParse((string)__jsonFirstUsageDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFirstUsageDateValue) ? __jsonFirstUsageDateValue : FirstUsageDate : FirstUsageDate;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_skuProperty = If( json?.PropertyT("skuProperties"), out var __jsonSkuProperties) ? If( __jsonSkuProperties as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ISkuProperty) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuProperty.FromJson(__u) )) ))() : null : SkuProperty;} + {_skuName = If( json?.PropertyT("skuName"), out var __jsonSkuName) ? (string)__jsonSkuName : (string)SkuName;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._costWithNoReservedInstance ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._costWithNoReservedInstance.ToJson(null,serializationMode) : null, "costWithNoReservedInstances" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalCostWithReservedInstance ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._totalCostWithReservedInstance.ToJson(null,serializationMode) : null, "totalCostWithReservedInstances" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._netSaving ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._netSaving.ToJson(null,serializationMode) : null, "netSavings" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lookBackPeriod ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((int)this._lookBackPeriod) : null, "lookBackPeriod" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._instanceFlexibilityRatio ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._instanceFlexibilityRatio) : null, "instanceFlexibilityRatio" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._instanceFlexibilityGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._instanceFlexibilityGroup.ToString()) : null, "instanceFlexibilityGroup" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._normalizedSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._normalizedSize.ToString()) : null, "normalizedSize" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._recommendedQuantityNormalized ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._recommendedQuantityNormalized) : null, "recommendedQuantityNormalized" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterId.ToString()) : null, "meterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._term)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._term.ToString()) : null, "term" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._recommendedQuantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._recommendedQuantity) : null, "recommendedQuantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._firstUsageDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._firstUsageDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "firstUsageDate" ,container.Add ); + } + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._skuProperty) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._skuProperty ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("skuProperties",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._skuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._skuName.ToString()) : null, "skuName" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransaction.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransaction.PowerShell.cs new file mode 100644 index 000000000000..04eed22ae8cd --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransaction.PowerShell.cs @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Modern Reservation transaction resource. + [System.ComponentModel.TypeConverter(typeof(ModernReservationTransactionTypeConverter))] + public partial class ModernReservationTransaction + { + + /// + /// 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.Consumption.Models.Api20211001.IModernReservationTransaction DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ModernReservationTransaction(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.Consumption.Models.Api20211001.IModernReservationTransaction DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ModernReservationTransaction(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.Consumption.Models.Api20211001.IModernReservationTransaction FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ModernReservationTransaction(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.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransactionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ArmSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).ArmSkuName = (string) content.GetValueForProperty("ArmSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).ArmSkuName, global::System.Convert.ToString); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).BillingFrequency = (string) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).BillingFrequency, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).BillingProfileName = (string) content.GetValueForProperty("BillingProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).BillingProfileName, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("EventDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).EventDate = (global::System.DateTime?) content.GetValueForProperty("EventDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).EventDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).EventType = (string) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).EventType, global::System.Convert.ToString); + } + if (content.Contains("Invoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Invoice = (string) content.GetValueForProperty("Invoice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Invoice, global::System.Convert.ToString); + } + if (content.Contains("InvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).InvoiceId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).InvoiceSectionId = (string) content.GetValueForProperty("InvoiceSectionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).InvoiceSectionId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).InvoiceSectionName = (string) content.GetValueForProperty("InvoiceSectionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).InvoiceSectionName, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).PurchasingSubscriptionGuid = (string) content.GetValueForProperty("PurchasingSubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).PurchasingSubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).PurchasingSubscriptionName = (string) content.GetValueForProperty("PurchasingSubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).PurchasingSubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).ReservationOrderName, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Term, 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 ModernReservationTransaction(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.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransactionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ArmSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).ArmSkuName = (string) content.GetValueForProperty("ArmSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).ArmSkuName, global::System.Convert.ToString); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).BillingFrequency = (string) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).BillingFrequency, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).BillingProfileName = (string) content.GetValueForProperty("BillingProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).BillingProfileName, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("EventDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).EventDate = (global::System.DateTime?) content.GetValueForProperty("EventDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).EventDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).EventType = (string) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).EventType, global::System.Convert.ToString); + } + if (content.Contains("Invoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Invoice = (string) content.GetValueForProperty("Invoice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Invoice, global::System.Convert.ToString); + } + if (content.Contains("InvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).InvoiceId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).InvoiceSectionId = (string) content.GetValueForProperty("InvoiceSectionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).InvoiceSectionId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).InvoiceSectionName = (string) content.GetValueForProperty("InvoiceSectionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).InvoiceSectionName, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).PurchasingSubscriptionGuid = (string) content.GetValueForProperty("PurchasingSubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).PurchasingSubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).PurchasingSubscriptionName = (string) content.GetValueForProperty("PurchasingSubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).PurchasingSubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).ReservationOrderName, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal)this).Term, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Modern Reservation transaction resource. + [System.ComponentModel.TypeConverter(typeof(ModernReservationTransactionTypeConverter))] + public partial interface IModernReservationTransaction + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransaction.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransaction.TypeConverter.cs new file mode 100644 index 000000000000..bccd99111ac6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransaction.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ModernReservationTransactionTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IModernReservationTransaction ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ModernReservationTransaction.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ModernReservationTransaction.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ModernReservationTransaction.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/consumption/generated/api/Models/Api20211001/ModernReservationTransaction.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransaction.cs new file mode 100644 index 000000000000..d49c4e680df0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransaction.cs @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Modern Reservation transaction resource. + public partial class ModernReservationTransaction : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResource __reservationTransactionResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransactionResource(); + + /// The charge of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? Amount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Amount; } + + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ArmSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).ArmSkuName; } + + /// The billing frequency, which can be either one-time or recurring. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).BillingFrequency; } + + /// Billing profile Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingProfileId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).BillingProfileId; } + + /// Billing profile name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingProfileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).BillingProfileName; } + + /// The ISO currency in which the transaction is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Currency; } + + /// The description of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Description; } + + /// The date of the transaction + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? EventDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).EventDate; } + + /// The type of the transaction (Purchase, Cancel or Refund). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string EventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).EventType; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Id; } + + /// Invoice Number + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Invoice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Invoice; } + + /// Invoice Id as on the invoice where the specific transaction appears. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).InvoiceId; } + + /// Invoice Section Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InvoiceSectionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).InvoiceSectionId; } + + /// Invoice Section Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InvoiceSectionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).InvoiceSectionName; } + + /// Internal Acessors for Amount + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.Amount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Amount = value; } + + /// Internal Acessors for ArmSkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.ArmSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).ArmSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).ArmSkuName = value; } + + /// Internal Acessors for BillingFrequency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.BillingFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).BillingFrequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).BillingFrequency = value; } + + /// Internal Acessors for BillingProfileId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.BillingProfileId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).BillingProfileId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).BillingProfileId = value; } + + /// Internal Acessors for BillingProfileName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.BillingProfileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).BillingProfileName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).BillingProfileName = value; } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Currency = value; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Description = value; } + + /// Internal Acessors for EventDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.EventDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).EventDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).EventDate = value; } + + /// Internal Acessors for EventType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.EventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).EventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).EventType = value; } + + /// Internal Acessors for Invoice + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.Invoice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Invoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Invoice = value; } + + /// Internal Acessors for InvoiceId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.InvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).InvoiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).InvoiceId = value; } + + /// Internal Acessors for InvoiceSectionId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.InvoiceSectionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).InvoiceSectionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).InvoiceSectionId = value; } + + /// Internal Acessors for InvoiceSectionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.InvoiceSectionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).InvoiceSectionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).InvoiceSectionName = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransactionProperties()); set { {_property = value;} } } + + /// Internal Acessors for PurchasingSubscriptionGuid + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.PurchasingSubscriptionGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).PurchasingSubscriptionGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).PurchasingSubscriptionGuid = value; } + + /// Internal Acessors for PurchasingSubscriptionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.PurchasingSubscriptionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).PurchasingSubscriptionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).PurchasingSubscriptionName = value; } + + /// Internal Acessors for Quantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Quantity = value; } + + /// Internal Acessors for Region + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.Region { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Region; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Region = value; } + + /// Internal Acessors for ReservationOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).ReservationOrderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).ReservationOrderId = value; } + + /// Internal Acessors for ReservationOrderName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.ReservationOrderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).ReservationOrderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).ReservationOrderName = value; } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionInternal.Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Term = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Name = value; } + + /// Internal Acessors for Tag + string[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionProperties _property; + + /// The properties of a modern reservation transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransactionProperties()); set => this._property = value; } + + /// The subscription guid that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PurchasingSubscriptionGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).PurchasingSubscriptionGuid; } + + /// The subscription name that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PurchasingSubscriptionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).PurchasingSubscriptionName; } + + /// The quantity of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Quantity; } + + /// The region of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Region { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Region; } + + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).ReservationOrderId; } + + /// The name of the reservation order. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ReservationOrderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).ReservationOrderName; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string[] Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Tag; } + + /// This is the term of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)Property).Term; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Type; } + + /// Creates an new instance. + public ModernReservationTransaction() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__reservationTransactionResource), __reservationTransactionResource); + await eventListener.AssertObjectIsValid(nameof(__reservationTransactionResource), __reservationTransactionResource); + } + } + /// Modern Reservation transaction resource. + public partial interface IModernReservationTransaction : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResource + { + /// The charge of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The charge of the transaction.", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Amount { get; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records.", + SerializedName = @"armSkuName", + PossibleTypes = new [] { typeof(string) })] + string ArmSkuName { get; } + /// The billing frequency, which can be either one-time or recurring. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing frequency, which can be either one-time or recurring.", + SerializedName = @"billingFrequency", + PossibleTypes = new [] { typeof(string) })] + string BillingFrequency { get; } + /// Billing profile Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing profile Id.", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileId { get; } + /// Billing profile name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing profile name.", + SerializedName = @"billingProfileName", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileName { get; } + /// The ISO currency in which the transaction is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ISO currency in which the transaction is charged, for example, USD.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// The description of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The description of the transaction.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// The date of the transaction + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date of the transaction", + SerializedName = @"eventDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EventDate { get; } + /// The type of the transaction (Purchase, Cancel or Refund). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the transaction (Purchase, Cancel or Refund).", + SerializedName = @"eventType", + PossibleTypes = new [] { typeof(string) })] + string EventType { get; } + /// Invoice Number + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice Number", + SerializedName = @"invoice", + PossibleTypes = new [] { typeof(string) })] + string Invoice { get; } + /// Invoice Id as on the invoice where the specific transaction appears. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice Id as on the invoice where the specific transaction appears.", + SerializedName = @"invoiceId", + PossibleTypes = new [] { typeof(string) })] + string InvoiceId { get; } + /// Invoice Section Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice Section Id", + SerializedName = @"invoiceSectionId", + PossibleTypes = new [] { typeof(string) })] + string InvoiceSectionId { get; } + /// Invoice Section Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice Section Name.", + SerializedName = @"invoiceSectionName", + PossibleTypes = new [] { typeof(string) })] + string InvoiceSectionName { get; } + /// The subscription guid that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subscription guid that makes the transaction.", + SerializedName = @"purchasingSubscriptionGuid", + PossibleTypes = new [] { typeof(string) })] + string PurchasingSubscriptionGuid { get; } + /// The subscription name that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subscription name that makes the transaction.", + SerializedName = @"purchasingSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + string PurchasingSubscriptionName { get; } + /// The quantity of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The quantity of the transaction.", + SerializedName = @"quantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Quantity { get; } + /// The region of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The region of the transaction.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + string Region { get; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations.", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderId { get; } + /// The name of the reservation order. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the reservation order.", + SerializedName = @"reservationOrderName", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderName { get; } + /// This is the term of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the term of the transaction.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(string) })] + string Term { get; } + + } + /// Modern Reservation transaction resource. + internal partial interface IModernReservationTransactionInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal + { + /// The charge of the transaction. + decimal? Amount { get; set; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + string ArmSkuName { get; set; } + /// The billing frequency, which can be either one-time or recurring. + string BillingFrequency { get; set; } + /// Billing profile Id. + string BillingProfileId { get; set; } + /// Billing profile name. + string BillingProfileName { get; set; } + /// The ISO currency in which the transaction is charged, for example, USD. + string Currency { get; set; } + /// The description of the transaction. + string Description { get; set; } + /// The date of the transaction + global::System.DateTime? EventDate { get; set; } + /// The type of the transaction (Purchase, Cancel or Refund). + string EventType { get; set; } + /// Invoice Number + string Invoice { get; set; } + /// Invoice Id as on the invoice where the specific transaction appears. + string InvoiceId { get; set; } + /// Invoice Section Id + string InvoiceSectionId { get; set; } + /// Invoice Section Name. + string InvoiceSectionName { get; set; } + /// The properties of a modern reservation transaction. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionProperties Property { get; set; } + /// The subscription guid that makes the transaction. + string PurchasingSubscriptionGuid { get; set; } + /// The subscription name that makes the transaction. + string PurchasingSubscriptionName { get; set; } + /// The quantity of the transaction. + decimal? Quantity { get; set; } + /// The region of the transaction. + string Region { get; set; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + string ReservationOrderId { get; set; } + /// The name of the reservation order. + string ReservationOrderName { get; set; } + /// This is the term of the transaction. + string Term { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransaction.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransaction.json.cs new file mode 100644 index 000000000000..770806ec421d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransaction.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Modern Reservation transaction resource. + public partial class ModernReservationTransaction + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ModernReservationTransaction(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ModernReservationTransaction(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __reservationTransactionResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransactionResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransactionProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __reservationTransactionResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ModernReservationTransactionProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionProperties.PowerShell.cs new file mode 100644 index 000000000000..fe0be8d74da1 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionProperties.PowerShell.cs @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of a modern reservation transaction. + [System.ComponentModel.TypeConverter(typeof(ModernReservationTransactionPropertiesTypeConverter))] + public partial class ModernReservationTransactionProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IModernReservationTransactionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ModernReservationTransactionProperties(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.Consumption.Models.Api20211001.IModernReservationTransactionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ModernReservationTransactionProperties(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.Consumption.Models.Api20211001.IModernReservationTransactionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ModernReservationTransactionProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ArmSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).ArmSkuName = (string) content.GetValueForProperty("ArmSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).ArmSkuName, global::System.Convert.ToString); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).BillingFrequency = (string) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).BillingFrequency, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).BillingProfileName = (string) content.GetValueForProperty("BillingProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).BillingProfileName, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("EventDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).EventDate = (global::System.DateTime?) content.GetValueForProperty("EventDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).EventDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).EventType = (string) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).EventType, global::System.Convert.ToString); + } + if (content.Contains("Invoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Invoice = (string) content.GetValueForProperty("Invoice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Invoice, global::System.Convert.ToString); + } + if (content.Contains("InvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).InvoiceId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).InvoiceSectionId = (string) content.GetValueForProperty("InvoiceSectionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).InvoiceSectionId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).InvoiceSectionName = (string) content.GetValueForProperty("InvoiceSectionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).InvoiceSectionName, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).PurchasingSubscriptionGuid = (string) content.GetValueForProperty("PurchasingSubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).PurchasingSubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).PurchasingSubscriptionName = (string) content.GetValueForProperty("PurchasingSubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).PurchasingSubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).ReservationOrderName, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Term, 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 ModernReservationTransactionProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ArmSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).ArmSkuName = (string) content.GetValueForProperty("ArmSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).ArmSkuName, global::System.Convert.ToString); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).BillingFrequency = (string) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).BillingFrequency, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).BillingProfileName = (string) content.GetValueForProperty("BillingProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).BillingProfileName, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("EventDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).EventDate = (global::System.DateTime?) content.GetValueForProperty("EventDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).EventDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).EventType = (string) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).EventType, global::System.Convert.ToString); + } + if (content.Contains("Invoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Invoice = (string) content.GetValueForProperty("Invoice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Invoice, global::System.Convert.ToString); + } + if (content.Contains("InvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).InvoiceId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).InvoiceSectionId = (string) content.GetValueForProperty("InvoiceSectionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).InvoiceSectionId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).InvoiceSectionName = (string) content.GetValueForProperty("InvoiceSectionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).InvoiceSectionName, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).PurchasingSubscriptionGuid = (string) content.GetValueForProperty("PurchasingSubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).PurchasingSubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).PurchasingSubscriptionName = (string) content.GetValueForProperty("PurchasingSubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).PurchasingSubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).ReservationOrderName, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal)this).Term, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of a modern reservation transaction. + [System.ComponentModel.TypeConverter(typeof(ModernReservationTransactionPropertiesTypeConverter))] + public partial interface IModernReservationTransactionProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionProperties.TypeConverter.cs new file mode 100644 index 000000000000..0455b3c3aa23 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ModernReservationTransactionPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IModernReservationTransactionProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ModernReservationTransactionProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ModernReservationTransactionProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ModernReservationTransactionProperties.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/consumption/generated/api/Models/Api20211001/ModernReservationTransactionProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionProperties.cs new file mode 100644 index 000000000000..cd5a5dd71bf1 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of a modern reservation transaction. + public partial class ModernReservationTransactionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal + { + + /// Backing field for property. + private decimal? _amount; + + /// The charge of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Amount { get => this._amount; } + + /// Backing field for property. + private string _armSkuName; + + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ArmSkuName { get => this._armSkuName; } + + /// Backing field for property. + private string _billingFrequency; + + /// The billing frequency, which can be either one-time or recurring. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingFrequency { get => this._billingFrequency; } + + /// Backing field for property. + private string _billingProfileId; + + /// Billing profile Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingProfileId { get => this._billingProfileId; } + + /// Backing field for property. + private string _billingProfileName; + + /// Billing profile name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingProfileName { get => this._billingProfileName; } + + /// Backing field for property. + private string _currency; + + /// The ISO currency in which the transaction is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Currency { get => this._currency; } + + /// Backing field for property. + private string _description; + + /// The description of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Backing field for property. + private global::System.DateTime? _eventDate; + + /// The date of the transaction + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? EventDate { get => this._eventDate; } + + /// Backing field for property. + private string _eventType; + + /// The type of the transaction (Purchase, Cancel or Refund). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string EventType { get => this._eventType; } + + /// Backing field for property. + private string _invoice; + + /// Invoice Number + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Invoice { get => this._invoice; } + + /// Backing field for property. + private string _invoiceId; + + /// Invoice Id as on the invoice where the specific transaction appears. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InvoiceId { get => this._invoiceId; } + + /// Backing field for property. + private string _invoiceSectionId; + + /// Invoice Section Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InvoiceSectionId { get => this._invoiceSectionId; } + + /// Backing field for property. + private string _invoiceSectionName; + + /// Invoice Section Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InvoiceSectionName { get => this._invoiceSectionName; } + + /// Internal Acessors for Amount + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.Amount { get => this._amount; set { {_amount = value;} } } + + /// Internal Acessors for ArmSkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.ArmSkuName { get => this._armSkuName; set { {_armSkuName = value;} } } + + /// Internal Acessors for BillingFrequency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.BillingFrequency { get => this._billingFrequency; set { {_billingFrequency = value;} } } + + /// Internal Acessors for BillingProfileId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.BillingProfileId { get => this._billingProfileId; set { {_billingProfileId = value;} } } + + /// Internal Acessors for BillingProfileName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.BillingProfileName { get => this._billingProfileName; set { {_billingProfileName = value;} } } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.Currency { get => this._currency; set { {_currency = value;} } } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for EventDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.EventDate { get => this._eventDate; set { {_eventDate = value;} } } + + /// Internal Acessors for EventType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.EventType { get => this._eventType; set { {_eventType = value;} } } + + /// Internal Acessors for Invoice + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.Invoice { get => this._invoice; set { {_invoice = value;} } } + + /// Internal Acessors for InvoiceId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.InvoiceId { get => this._invoiceId; set { {_invoiceId = value;} } } + + /// Internal Acessors for InvoiceSectionId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.InvoiceSectionId { get => this._invoiceSectionId; set { {_invoiceSectionId = value;} } } + + /// Internal Acessors for InvoiceSectionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.InvoiceSectionName { get => this._invoiceSectionName; set { {_invoiceSectionName = value;} } } + + /// Internal Acessors for PurchasingSubscriptionGuid + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.PurchasingSubscriptionGuid { get => this._purchasingSubscriptionGuid; set { {_purchasingSubscriptionGuid = value;} } } + + /// Internal Acessors for PurchasingSubscriptionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.PurchasingSubscriptionName { get => this._purchasingSubscriptionName; set { {_purchasingSubscriptionName = value;} } } + + /// Internal Acessors for Quantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.Quantity { get => this._quantity; set { {_quantity = value;} } } + + /// Internal Acessors for Region + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.Region { get => this._region; set { {_region = value;} } } + + /// Internal Acessors for ReservationOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.ReservationOrderId { get => this._reservationOrderId; set { {_reservationOrderId = value;} } } + + /// Internal Acessors for ReservationOrderName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.ReservationOrderName { get => this._reservationOrderName; set { {_reservationOrderName = value;} } } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionPropertiesInternal.Term { get => this._term; set { {_term = value;} } } + + /// Backing field for property. + private string _purchasingSubscriptionGuid; + + /// The subscription guid that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PurchasingSubscriptionGuid { get => this._purchasingSubscriptionGuid; } + + /// Backing field for property. + private string _purchasingSubscriptionName; + + /// The subscription name that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PurchasingSubscriptionName { get => this._purchasingSubscriptionName; } + + /// Backing field for property. + private decimal? _quantity; + + /// The quantity of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Quantity { get => this._quantity; } + + /// Backing field for property. + private string _region; + + /// The region of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Region { get => this._region; } + + /// Backing field for property. + private string _reservationOrderId; + + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationOrderId { get => this._reservationOrderId; } + + /// Backing field for property. + private string _reservationOrderName; + + /// The name of the reservation order. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationOrderName { get => this._reservationOrderName; } + + /// Backing field for property. + private string _term; + + /// This is the term of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Term { get => this._term; } + + /// Creates an new instance. + public ModernReservationTransactionProperties() + { + + } + } + /// The properties of a modern reservation transaction. + public partial interface IModernReservationTransactionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The charge of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The charge of the transaction.", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Amount { get; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records.", + SerializedName = @"armSkuName", + PossibleTypes = new [] { typeof(string) })] + string ArmSkuName { get; } + /// The billing frequency, which can be either one-time or recurring. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing frequency, which can be either one-time or recurring.", + SerializedName = @"billingFrequency", + PossibleTypes = new [] { typeof(string) })] + string BillingFrequency { get; } + /// Billing profile Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing profile Id.", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileId { get; } + /// Billing profile name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing profile name.", + SerializedName = @"billingProfileName", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileName { get; } + /// The ISO currency in which the transaction is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ISO currency in which the transaction is charged, for example, USD.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// The description of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The description of the transaction.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// The date of the transaction + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date of the transaction", + SerializedName = @"eventDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EventDate { get; } + /// The type of the transaction (Purchase, Cancel or Refund). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the transaction (Purchase, Cancel or Refund).", + SerializedName = @"eventType", + PossibleTypes = new [] { typeof(string) })] + string EventType { get; } + /// Invoice Number + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice Number", + SerializedName = @"invoice", + PossibleTypes = new [] { typeof(string) })] + string Invoice { get; } + /// Invoice Id as on the invoice where the specific transaction appears. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice Id as on the invoice where the specific transaction appears.", + SerializedName = @"invoiceId", + PossibleTypes = new [] { typeof(string) })] + string InvoiceId { get; } + /// Invoice Section Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice Section Id", + SerializedName = @"invoiceSectionId", + PossibleTypes = new [] { typeof(string) })] + string InvoiceSectionId { get; } + /// Invoice Section Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice Section Name.", + SerializedName = @"invoiceSectionName", + PossibleTypes = new [] { typeof(string) })] + string InvoiceSectionName { get; } + /// The subscription guid that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subscription guid that makes the transaction.", + SerializedName = @"purchasingSubscriptionGuid", + PossibleTypes = new [] { typeof(string) })] + string PurchasingSubscriptionGuid { get; } + /// The subscription name that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subscription name that makes the transaction.", + SerializedName = @"purchasingSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + string PurchasingSubscriptionName { get; } + /// The quantity of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The quantity of the transaction.", + SerializedName = @"quantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Quantity { get; } + /// The region of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The region of the transaction.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + string Region { get; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations.", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderId { get; } + /// The name of the reservation order. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the reservation order.", + SerializedName = @"reservationOrderName", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderName { get; } + /// This is the term of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the term of the transaction.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(string) })] + string Term { get; } + + } + /// The properties of a modern reservation transaction. + internal partial interface IModernReservationTransactionPropertiesInternal + + { + /// The charge of the transaction. + decimal? Amount { get; set; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + string ArmSkuName { get; set; } + /// The billing frequency, which can be either one-time or recurring. + string BillingFrequency { get; set; } + /// Billing profile Id. + string BillingProfileId { get; set; } + /// Billing profile name. + string BillingProfileName { get; set; } + /// The ISO currency in which the transaction is charged, for example, USD. + string Currency { get; set; } + /// The description of the transaction. + string Description { get; set; } + /// The date of the transaction + global::System.DateTime? EventDate { get; set; } + /// The type of the transaction (Purchase, Cancel or Refund). + string EventType { get; set; } + /// Invoice Number + string Invoice { get; set; } + /// Invoice Id as on the invoice where the specific transaction appears. + string InvoiceId { get; set; } + /// Invoice Section Id + string InvoiceSectionId { get; set; } + /// Invoice Section Name. + string InvoiceSectionName { get; set; } + /// The subscription guid that makes the transaction. + string PurchasingSubscriptionGuid { get; set; } + /// The subscription name that makes the transaction. + string PurchasingSubscriptionName { get; set; } + /// The quantity of the transaction. + decimal? Quantity { get; set; } + /// The region of the transaction. + string Region { get; set; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + string ReservationOrderId { get; set; } + /// The name of the reservation order. + string ReservationOrderName { get; set; } + /// This is the term of the transaction. + string Term { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionProperties.json.cs new file mode 100644 index 000000000000..311786b3ff91 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionProperties.json.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of a modern reservation transaction. + public partial class ModernReservationTransactionProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ModernReservationTransactionProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ModernReservationTransactionProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (decimal?)__jsonAmount : Amount;} + {_armSkuName = If( json?.PropertyT("armSkuName"), out var __jsonArmSkuName) ? (string)__jsonArmSkuName : (string)ArmSkuName;} + {_billingFrequency = If( json?.PropertyT("billingFrequency"), out var __jsonBillingFrequency) ? (string)__jsonBillingFrequency : (string)BillingFrequency;} + {_billingProfileId = If( json?.PropertyT("billingProfileId"), out var __jsonBillingProfileId) ? (string)__jsonBillingProfileId : (string)BillingProfileId;} + {_billingProfileName = If( json?.PropertyT("billingProfileName"), out var __jsonBillingProfileName) ? (string)__jsonBillingProfileName : (string)BillingProfileName;} + {_currency = If( json?.PropertyT("currency"), out var __jsonCurrency) ? (string)__jsonCurrency : (string)Currency;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_eventDate = If( json?.PropertyT("eventDate"), out var __jsonEventDate) ? global::System.DateTime.TryParse((string)__jsonEventDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEventDateValue) ? __jsonEventDateValue : EventDate : EventDate;} + {_eventType = If( json?.PropertyT("eventType"), out var __jsonEventType) ? (string)__jsonEventType : (string)EventType;} + {_invoice = If( json?.PropertyT("invoice"), out var __jsonInvoice) ? (string)__jsonInvoice : (string)Invoice;} + {_invoiceId = If( json?.PropertyT("invoiceId"), out var __jsonInvoiceId) ? (string)__jsonInvoiceId : (string)InvoiceId;} + {_invoiceSectionId = If( json?.PropertyT("invoiceSectionId"), out var __jsonInvoiceSectionId) ? (string)__jsonInvoiceSectionId : (string)InvoiceSectionId;} + {_invoiceSectionName = If( json?.PropertyT("invoiceSectionName"), out var __jsonInvoiceSectionName) ? (string)__jsonInvoiceSectionName : (string)InvoiceSectionName;} + {_purchasingSubscriptionGuid = If( json?.PropertyT("purchasingSubscriptionGuid"), out var __jsonPurchasingSubscriptionGuid) ? (string)__jsonPurchasingSubscriptionGuid : (string)PurchasingSubscriptionGuid;} + {_purchasingSubscriptionName = If( json?.PropertyT("purchasingSubscriptionName"), out var __jsonPurchasingSubscriptionName) ? (string)__jsonPurchasingSubscriptionName : (string)PurchasingSubscriptionName;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (decimal?)__jsonQuantity : Quantity;} + {_region = If( json?.PropertyT("region"), out var __jsonRegion) ? (string)__jsonRegion : (string)Region;} + {_reservationOrderId = If( json?.PropertyT("reservationOrderId"), out var __jsonReservationOrderId) ? (string)__jsonReservationOrderId : (string)ReservationOrderId;} + {_reservationOrderName = If( json?.PropertyT("reservationOrderName"), out var __jsonReservationOrderName) ? (string)__jsonReservationOrderName : (string)ReservationOrderName;} + {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)Term;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._amount ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._amount) : null, "amount" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._armSkuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._armSkuName.ToString()) : null, "armSkuName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingFrequency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingFrequency.ToString()) : null, "billingFrequency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingProfileId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingProfileId.ToString()) : null, "billingProfileId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingProfileName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingProfileName.ToString()) : null, "billingProfileName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._currency.ToString()) : null, "currency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._eventDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._eventDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "eventDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._eventType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._eventType.ToString()) : null, "eventType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._invoice)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._invoice.ToString()) : null, "invoice" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._invoiceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._invoiceId.ToString()) : null, "invoiceId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._invoiceSectionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._invoiceSectionId.ToString()) : null, "invoiceSectionId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._invoiceSectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._invoiceSectionName.ToString()) : null, "invoiceSectionName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._purchasingSubscriptionGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._purchasingSubscriptionGuid.ToString()) : null, "purchasingSubscriptionGuid" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._purchasingSubscriptionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._purchasingSubscriptionName.ToString()) : null, "purchasingSubscriptionName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._quantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._quantity) : null, "quantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._region)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._region.ToString()) : null, "region" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationOrderId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationOrderId.ToString()) : null, "reservationOrderId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationOrderName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationOrderName.ToString()) : null, "reservationOrderName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._term)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._term.ToString()) : null, "term" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionsListResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionsListResult.PowerShell.cs new file mode 100644 index 000000000000..d8f78ec1ea69 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionsListResult.PowerShell.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Result of listing reservation recommendations. + [System.ComponentModel.TypeConverter(typeof(ModernReservationTransactionsListResultTypeConverter))] + public partial class ModernReservationTransactionsListResult + { + + /// + /// 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.Consumption.Models.Api20211001.IModernReservationTransactionsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ModernReservationTransactionsListResult(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.Consumption.Models.Api20211001.IModernReservationTransactionsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ModernReservationTransactionsListResult(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.Consumption.Models.Api20211001.IModernReservationTransactionsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ModernReservationTransactionsListResult(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.Consumption.Models.Api20211001.IModernReservationTransactionsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransactionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResultInternal)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 ModernReservationTransactionsListResult(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.Consumption.Models.Api20211001.IModernReservationTransactionsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransactionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResultInternal)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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing reservation recommendations. + [System.ComponentModel.TypeConverter(typeof(ModernReservationTransactionsListResultTypeConverter))] + public partial interface IModernReservationTransactionsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionsListResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionsListResult.TypeConverter.cs new file mode 100644 index 000000000000..b1e1b1c38bfc --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionsListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ModernReservationTransactionsListResultTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IModernReservationTransactionsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ModernReservationTransactionsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ModernReservationTransactionsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ModernReservationTransactionsListResult.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/consumption/generated/api/Models/Api20211001/ModernReservationTransactionsListResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionsListResult.cs new file mode 100644 index 000000000000..b893a53b67f6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionsListResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing reservation recommendations. + public partial class ModernReservationTransactionsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResultInternal.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction[] _value; + + /// The list of reservation recommendations. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction[] Value { get => this._value; } + + /// Creates an new instance. + public ModernReservationTransactionsListResult() + { + + } + } + /// Result of listing reservation recommendations. + public partial interface IModernReservationTransactionsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 reservation recommendations. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of reservation recommendations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction[] Value { get; } + + } + /// Result of listing reservation recommendations. + internal partial interface IModernReservationTransactionsListResultInternal + + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The list of reservation recommendations. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionsListResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionsListResult.json.cs new file mode 100644 index 000000000000..933fe85ab48f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernReservationTransactionsListResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing reservation recommendations. + public partial class ModernReservationTransactionsListResult + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransactionsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ModernReservationTransactionsListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ModernReservationTransactionsListResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IModernReservationTransaction) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationTransaction.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ModernSharedScopeReservationRecommendationProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSharedScopeReservationRecommendationProperties.PowerShell.cs new file mode 100644 index 000000000000..3eb2496840c3 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSharedScopeReservationRecommendationProperties.PowerShell.cs @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the modern reservation recommendation for shared scope. + [System.ComponentModel.TypeConverter(typeof(ModernSharedScopeReservationRecommendationPropertiesTypeConverter))] + public partial class ModernSharedScopeReservationRecommendationProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IModernSharedScopeReservationRecommendationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ModernSharedScopeReservationRecommendationProperties(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.Consumption.Models.Api20211001.IModernSharedScopeReservationRecommendationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ModernSharedScopeReservationRecommendationProperties(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.Consumption.Models.Api20211001.IModernSharedScopeReservationRecommendationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ModernSharedScopeReservationRecommendationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CostWithNoReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceCurrency = (string) content.GetValueForProperty("CostWithNoReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceValue = (decimal?) content.GetValueForProperty("CostWithNoReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceCurrency = (string) content.GetValueForProperty("TotalCostWithReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("TotalCostWithReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceValue = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSavingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingCurrency = (string) content.GetValueForProperty("NetSavingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingCurrency, global::System.Convert.ToString); + } + if (content.Contains("NetSavingValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingValue = (decimal?) content.GetValueForProperty("NetSavingValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSaving, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).LookBackPeriod = (int?) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).LookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuName, 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 ModernSharedScopeReservationRecommendationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CostWithNoReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceCurrency = (string) content.GetValueForProperty("CostWithNoReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceValue = (decimal?) content.GetValueForProperty("CostWithNoReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceCurrency = (string) content.GetValueForProperty("TotalCostWithReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("TotalCostWithReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceValue = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSavingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingCurrency = (string) content.GetValueForProperty("NetSavingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingCurrency, global::System.Convert.ToString); + } + if (content.Contains("NetSavingValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingValue = (decimal?) content.GetValueForProperty("NetSavingValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSaving, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).LookBackPeriod = (int?) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).LookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuName, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the modern reservation recommendation for shared scope. + [System.ComponentModel.TypeConverter(typeof(ModernSharedScopeReservationRecommendationPropertiesTypeConverter))] + public partial interface IModernSharedScopeReservationRecommendationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernSharedScopeReservationRecommendationProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSharedScopeReservationRecommendationProperties.TypeConverter.cs new file mode 100644 index 000000000000..25ffe7ae13bc --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSharedScopeReservationRecommendationProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ModernSharedScopeReservationRecommendationPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IModernSharedScopeReservationRecommendationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSharedScopeReservationRecommendationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ModernSharedScopeReservationRecommendationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ModernSharedScopeReservationRecommendationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ModernSharedScopeReservationRecommendationProperties.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/consumption/generated/api/Models/Api20211001/ModernSharedScopeReservationRecommendationProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSharedScopeReservationRecommendationProperties.cs new file mode 100644 index 000000000000..f65934a3f6f6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSharedScopeReservationRecommendationProperties.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the modern reservation recommendation for shared scope. + public partial class ModernSharedScopeReservationRecommendationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSharedScopeReservationRecommendationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSharedScopeReservationRecommendationPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties __modernReservationRecommendationProperties = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendationProperties(); + + /// The total amount of cost without reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CostWithNoReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstance; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string CostWithNoReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstanceCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? CostWithNoReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstanceValue; } + + /// The usage date for looking back. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public global::System.DateTime? FirstUsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).FirstUsageDate; } + + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).InstanceFlexibilityGroup; } + + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public float? InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).InstanceFlexibilityRatio; } + + /// Resource Location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Location; } + + /// The number of days of usage to look back for recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public int? LookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).LookBackPeriod; } + + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).MeterId; } + + /// Internal Acessors for CostWithNoReservedInstance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.CostWithNoReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstance = value; } + + /// Internal Acessors for CostWithNoReservedInstanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.CostWithNoReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstanceCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstanceCurrency = value; } + + /// Internal Acessors for CostWithNoReservedInstanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.CostWithNoReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstanceValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstanceValue = value; } + + /// Internal Acessors for FirstUsageDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.FirstUsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).FirstUsageDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).FirstUsageDate = value; } + + /// Internal Acessors for InstanceFlexibilityGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).InstanceFlexibilityGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).InstanceFlexibilityGroup = value; } + + /// Internal Acessors for InstanceFlexibilityRatio + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).InstanceFlexibilityRatio; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).InstanceFlexibilityRatio = value; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Location = value; } + + /// Internal Acessors for LookBackPeriod + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.LookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).LookBackPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).LookBackPeriod = value; } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).MeterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).MeterId = value; } + + /// Internal Acessors for NetSaving + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.NetSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSaving; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSaving = value; } + + /// Internal Acessors for NetSavingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.NetSavingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSavingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSavingCurrency = value; } + + /// Internal Acessors for NetSavingValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.NetSavingValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSavingValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSavingValue = value; } + + /// Internal Acessors for NormalizedSize + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.NormalizedSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NormalizedSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NormalizedSize = value; } + + /// Internal Acessors for RecommendedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.RecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).RecommendedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).RecommendedQuantity = value; } + + /// Internal Acessors for RecommendedQuantityNormalized + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.RecommendedQuantityNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).RecommendedQuantityNormalized; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).RecommendedQuantityNormalized = value; } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).ResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).ResourceType = value; } + + /// Internal Acessors for SkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).SkuName = value; } + + /// Internal Acessors for SkuProperty + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.SkuProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).SkuProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).SkuProperty = value; } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Term = value; } + + /// Internal Acessors for TotalCostWithReservedInstance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.TotalCostWithReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstance = value; } + + /// Internal Acessors for TotalCostWithReservedInstanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.TotalCostWithReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstanceCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstanceCurrency = value; } + + /// Internal Acessors for TotalCostWithReservedInstanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.TotalCostWithReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstanceValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstanceValue = value; } + + /// Total estimated savings with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount NetSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSaving; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string NetSavingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSavingCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? NetSavingValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSavingValue; } + + /// The normalized Size. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string NormalizedSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NormalizedSize; } + + /// Recommended quality for reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? RecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).RecommendedQuantity; } + + /// The recommended Quantity Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public float? RecommendedQuantityNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).RecommendedQuantityNormalized; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).ResourceType; } + + /// Shared or single recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Scope = value ; } + + /// This is the ARM Sku name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).SkuName; } + + /// List of sku properties + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).SkuProperty; } + + /// RI recommendations in one or three year terms. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Term; } + + /// The total amount of cost with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount TotalCostWithReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstance; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string TotalCostWithReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstanceCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? TotalCostWithReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstanceValue; } + + /// + /// Creates an new instance. + /// + public ModernSharedScopeReservationRecommendationProperties() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__modernReservationRecommendationProperties), __modernReservationRecommendationProperties); + await eventListener.AssertObjectIsValid(nameof(__modernReservationRecommendationProperties), __modernReservationRecommendationProperties); + } + } + /// The properties of the modern reservation recommendation for shared scope. + public partial interface IModernSharedScopeReservationRecommendationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties + { + + } + /// The properties of the modern reservation recommendation for shared scope. + internal partial interface IModernSharedScopeReservationRecommendationPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernSharedScopeReservationRecommendationProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSharedScopeReservationRecommendationProperties.json.cs new file mode 100644 index 000000000000..00824b1bbf2f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSharedScopeReservationRecommendationProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the modern reservation recommendation for shared scope. + public partial class ModernSharedScopeReservationRecommendationProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSharedScopeReservationRecommendationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSharedScopeReservationRecommendationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSharedScopeReservationRecommendationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ModernSharedScopeReservationRecommendationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ModernSharedScopeReservationRecommendationProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __modernReservationRecommendationProperties = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendationProperties(json); + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __modernReservationRecommendationProperties?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernSingleScopeReservationRecommendationProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSingleScopeReservationRecommendationProperties.PowerShell.cs new file mode 100644 index 000000000000..77fbcb55370e --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSingleScopeReservationRecommendationProperties.PowerShell.cs @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the modern reservation recommendation for single scope. + [System.ComponentModel.TypeConverter(typeof(ModernSingleScopeReservationRecommendationPropertiesTypeConverter))] + public partial class ModernSingleScopeReservationRecommendationProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ModernSingleScopeReservationRecommendationProperties(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.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ModernSingleScopeReservationRecommendationProperties(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.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ModernSingleScopeReservationRecommendationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationPropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationPropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceCurrency = (string) content.GetValueForProperty("CostWithNoReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceValue = (decimal?) content.GetValueForProperty("CostWithNoReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceCurrency = (string) content.GetValueForProperty("TotalCostWithReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("TotalCostWithReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceValue = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSavingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingCurrency = (string) content.GetValueForProperty("NetSavingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingCurrency, global::System.Convert.ToString); + } + if (content.Contains("NetSavingValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingValue = (decimal?) content.GetValueForProperty("NetSavingValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSaving, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).LookBackPeriod = (int?) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).LookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuName, 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 ModernSingleScopeReservationRecommendationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationPropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationPropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceCurrency = (string) content.GetValueForProperty("CostWithNoReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("CostWithNoReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceValue = (decimal?) content.GetValueForProperty("CostWithNoReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalCostWithReservedInstanceCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceCurrency = (string) content.GetValueForProperty("TotalCostWithReservedInstanceCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceCurrency, global::System.Convert.ToString); + } + if (content.Contains("TotalCostWithReservedInstanceValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceValue = (decimal?) content.GetValueForProperty("TotalCostWithReservedInstanceValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstanceValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("NetSavingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingCurrency = (string) content.GetValueForProperty("NetSavingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingCurrency, global::System.Convert.ToString); + } + if (content.Contains("NetSavingValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingValue = (decimal?) content.GetValueForProperty("NetSavingValue",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSavingValue, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CostWithNoReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("CostWithNoReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).CostWithNoReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("TotalCostWithReservedInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("TotalCostWithReservedInstance",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).TotalCostWithReservedInstance, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("NetSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount) content.GetValueForProperty("NetSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NetSaving, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.AmountTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).LookBackPeriod = (int?) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).LookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio = (float?) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityRatio, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("NormalizedSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NormalizedSize = (string) content.GetValueForProperty("NormalizedSize",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).NormalizedSize, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantityNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized = (float?) content.GetValueForProperty("RecommendedQuantityNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantityNormalized, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantity = (decimal?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).RecommendedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("FirstUsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).FirstUsageDate = (global::System.DateTime?) content.GetValueForProperty("FirstUsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).FirstUsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("SkuProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuProperty = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[]) content.GetValueForProperty("SkuProperty",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuProperty, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.SkuPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)this).SkuName, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the modern reservation recommendation for single scope. + [System.ComponentModel.TypeConverter(typeof(ModernSingleScopeReservationRecommendationPropertiesTypeConverter))] + public partial interface IModernSingleScopeReservationRecommendationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernSingleScopeReservationRecommendationProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSingleScopeReservationRecommendationProperties.TypeConverter.cs new file mode 100644 index 000000000000..66cbf027f016 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSingleScopeReservationRecommendationProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ModernSingleScopeReservationRecommendationPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ModernSingleScopeReservationRecommendationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ModernSingleScopeReservationRecommendationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ModernSingleScopeReservationRecommendationProperties.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/consumption/generated/api/Models/Api20211001/ModernSingleScopeReservationRecommendationProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSingleScopeReservationRecommendationProperties.cs new file mode 100644 index 000000000000..3e2717bc11a0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSingleScopeReservationRecommendationProperties.cs @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the modern reservation recommendation for single scope. + public partial class ModernSingleScopeReservationRecommendationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties __modernReservationRecommendationProperties = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendationProperties(); + + /// The total amount of cost without reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount CostWithNoReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstance; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string CostWithNoReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstanceCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? CostWithNoReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstanceValue; } + + /// The usage date for looking back. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public global::System.DateTime? FirstUsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).FirstUsageDate; } + + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).InstanceFlexibilityGroup; } + + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public float? InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).InstanceFlexibilityRatio; } + + /// Resource Location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Location; } + + /// The number of days of usage to look back for recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public int? LookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).LookBackPeriod; } + + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).MeterId; } + + /// Internal Acessors for CostWithNoReservedInstance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.CostWithNoReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstance = value; } + + /// Internal Acessors for CostWithNoReservedInstanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.CostWithNoReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstanceCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstanceCurrency = value; } + + /// Internal Acessors for CostWithNoReservedInstanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.CostWithNoReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstanceValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).CostWithNoReservedInstanceValue = value; } + + /// Internal Acessors for FirstUsageDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.FirstUsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).FirstUsageDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).FirstUsageDate = value; } + + /// Internal Acessors for InstanceFlexibilityGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).InstanceFlexibilityGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).InstanceFlexibilityGroup = value; } + + /// Internal Acessors for InstanceFlexibilityRatio + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).InstanceFlexibilityRatio; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).InstanceFlexibilityRatio = value; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Location = value; } + + /// Internal Acessors for LookBackPeriod + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.LookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).LookBackPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).LookBackPeriod = value; } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).MeterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).MeterId = value; } + + /// Internal Acessors for NetSaving + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.NetSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSaving; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSaving = value; } + + /// Internal Acessors for NetSavingCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.NetSavingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSavingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSavingCurrency = value; } + + /// Internal Acessors for NetSavingValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.NetSavingValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSavingValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSavingValue = value; } + + /// Internal Acessors for NormalizedSize + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.NormalizedSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NormalizedSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NormalizedSize = value; } + + /// Internal Acessors for RecommendedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.RecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).RecommendedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).RecommendedQuantity = value; } + + /// Internal Acessors for RecommendedQuantityNormalized + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.RecommendedQuantityNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).RecommendedQuantityNormalized; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).RecommendedQuantityNormalized = value; } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).ResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).ResourceType = value; } + + /// Internal Acessors for SkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).SkuName = value; } + + /// Internal Acessors for SkuProperty + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.SkuProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).SkuProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).SkuProperty = value; } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Term = value; } + + /// Internal Acessors for TotalCostWithReservedInstance + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.TotalCostWithReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstance = value; } + + /// Internal Acessors for TotalCostWithReservedInstanceCurrency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.TotalCostWithReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstanceCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstanceCurrency = value; } + + /// Internal Acessors for TotalCostWithReservedInstanceValue + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal.TotalCostWithReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstanceValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstanceValue = value; } + + /// Internal Acessors for SubscriptionId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationPropertiesInternal.SubscriptionId { get => this._subscriptionId; set { {_subscriptionId = value;} } } + + /// Total estimated savings with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount NetSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSaving; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string NetSavingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSavingCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? NetSavingValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NetSavingValue; } + + /// The normalized Size. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string NormalizedSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).NormalizedSize; } + + /// Recommended quality for reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? RecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).RecommendedQuantity; } + + /// The recommended Quantity Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public float? RecommendedQuantityNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).RecommendedQuantityNormalized; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).ResourceType; } + + /// Shared or single recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Scope = value ; } + + /// This is the ARM Sku name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).SkuName; } + + /// List of sku properties + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty[] SkuProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).SkuProperty; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription ID associated with single scoped recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; } + + /// RI recommendations in one or three year terms. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).Term; } + + /// The total amount of cost with reserved instances. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IAmount TotalCostWithReservedInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstance; } + + /// Amount currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string TotalCostWithReservedInstanceCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstanceCurrency; } + + /// Amount. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public decimal? TotalCostWithReservedInstanceValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal)__modernReservationRecommendationProperties).TotalCostWithReservedInstanceValue; } + + /// + /// Creates an new instance. + /// + public ModernSingleScopeReservationRecommendationProperties() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__modernReservationRecommendationProperties), __modernReservationRecommendationProperties); + await eventListener.AssertObjectIsValid(nameof(__modernReservationRecommendationProperties), __modernReservationRecommendationProperties); + } + } + /// The properties of the modern reservation recommendation for single scope. + public partial interface IModernSingleScopeReservationRecommendationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationProperties + { + /// Subscription ID associated with single scoped recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Subscription ID associated with single scoped recommendation.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; } + + } + /// The properties of the modern reservation recommendation for single scope. + internal partial interface IModernSingleScopeReservationRecommendationPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationRecommendationPropertiesInternal + { + /// Subscription ID associated with single scoped recommendation. + string SubscriptionId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernSingleScopeReservationRecommendationProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSingleScopeReservationRecommendationProperties.json.cs new file mode 100644 index 000000000000..c1a783aa9721 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernSingleScopeReservationRecommendationProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the modern reservation recommendation for single scope. + public partial class ModernSingleScopeReservationRecommendationProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernSingleScopeReservationRecommendationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ModernSingleScopeReservationRecommendationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ModernSingleScopeReservationRecommendationProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __modernReservationRecommendationProperties = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernReservationRecommendationProperties(json); + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __modernReservationRecommendationProperties?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetail.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetail.PowerShell.cs new file mode 100644 index 000000000000..49d07f08e234 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetail.PowerShell.cs @@ -0,0 +1,768 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Modern usage detail. + [System.ComponentModel.TypeConverter(typeof(ModernUsageDetailTypeConverter))] + public partial class ModernUsageDetail + { + + /// + /// 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.Consumption.Models.Api20211001.IModernUsageDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ModernUsageDetail(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.Consumption.Models.Api20211001.IModernUsageDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ModernUsageDetail(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.Consumption.Models.Api20211001.IModernUsageDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ModernUsageDetail(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.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernUsageDetailPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind.CreateFrom); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("EffectivePrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).EffectivePrice = (decimal?) content.GetValueForProperty("EffectivePrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).EffectivePrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PricingModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PricingModel = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType?) content.GetValueForProperty("PricingModel",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PricingModel, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType.CreateFrom); + } + if (content.Contains("BillingAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingAccountName = (string) content.GetValueForProperty("BillingAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingAccountName, global::System.Convert.ToString); + } + if (content.Contains("BillingPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingPeriodStartDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingPeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingPeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingPeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingPeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingProfileName = (string) content.GetValueForProperty("BillingProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingProfileName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).SubscriptionGuid = (string) content.GetValueForProperty("SubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).SubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).SubscriptionName = (string) content.GetValueForProperty("SubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).SubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("Date")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Date = (global::System.DateTime?) content.GetValueForProperty("Date",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Date, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Product")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Product, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("MeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterName = (string) content.GetValueForProperty("MeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterRegion = (string) content.GetValueForProperty("MeterRegion",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterRegion, global::System.Convert.ToString); + } + if (content.Contains("MeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterCategory = (string) content.GetValueForProperty("MeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterSubCategory = (string) content.GetValueForProperty("MeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("ServiceFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServiceFamily = (string) content.GetValueForProperty("ServiceFamily",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServiceFamily, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).UnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("InstanceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InstanceName = (string) content.GetValueForProperty("InstanceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InstanceName, global::System.Convert.ToString); + } + if (content.Contains("CostInUsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostInUsd = (decimal?) content.GetValueForProperty("CostInUsd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostInUsd, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).UnitPrice = (decimal?) content.GetValueForProperty("UnitPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).UnitPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BillingCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingCurrencyCode = (string) content.GetValueForProperty("BillingCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("ConsumedService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ConsumedService = (string) content.GetValueForProperty("ConsumedService",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ConsumedService, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServiceInfo1 = (string) content.GetValueForProperty("ServiceInfo1",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServiceInfo1, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServiceInfo2 = (string) content.GetValueForProperty("ServiceInfo2",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServiceInfo2, global::System.Convert.ToString); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InvoiceSectionId = (string) content.GetValueForProperty("InvoiceSectionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InvoiceSectionId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InvoiceSectionName = (string) content.GetValueForProperty("InvoiceSectionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InvoiceSectionName, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("ReservationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ReservationName = (string) content.GetValueForProperty("ReservationName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ReservationName, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ProductOrderId = (string) content.GetValueForProperty("ProductOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ProductOrderId, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ProductOrderName = (string) content.GetValueForProperty("ProductOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ProductOrderName, global::System.Convert.ToString); + } + if (content.Contains("IsAzureCreditEligible")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).IsAzureCreditEligible = (bool?) content.GetValueForProperty("IsAzureCreditEligible",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).IsAzureCreditEligible, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("PublisherName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PublisherName = (string) content.GetValueForProperty("PublisherName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PublisherName, global::System.Convert.ToString); + } + if (content.Contains("PublisherType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PublisherType = (string) content.GetValueForProperty("PublisherType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PublisherType, global::System.Convert.ToString); + } + if (content.Contains("ChargeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ChargeType = (string) content.GetValueForProperty("ChargeType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ChargeType, global::System.Convert.ToString); + } + if (content.Contains("Frequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Frequency = (string) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Frequency, global::System.Convert.ToString); + } + if (content.Contains("CostInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostInBillingCurrency = (decimal?) content.GetValueForProperty("CostInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostInBillingCurrency, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CostInPricingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostInPricingCurrency = (decimal?) content.GetValueForProperty("CostInPricingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostInPricingCurrency, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ExchangeRate = (string) content.GetValueForProperty("ExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ExchangeRate, global::System.Convert.ToString); + } + if (content.Contains("ExchangeRateDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ExchangeRateDate = (global::System.DateTime?) content.GetValueForProperty("ExchangeRateDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ExchangeRateDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InvoiceId, global::System.Convert.ToString); + } + if (content.Contains("PreviousInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PreviousInvoiceId = (string) content.GetValueForProperty("PreviousInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PreviousInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("PricingCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PricingCurrencyCode = (string) content.GetValueForProperty("PricingCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PricingCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("ProductIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ProductIdentifier = (string) content.GetValueForProperty("ProductIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ProductIdentifier, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocationNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResourceLocationNormalized = (string) content.GetValueForProperty("ResourceLocationNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResourceLocationNormalized, global::System.Convert.ToString); + } + if (content.Contains("ServicePeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServicePeriodStartDate = (global::System.DateTime?) content.GetValueForProperty("ServicePeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServicePeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ServicePeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServicePeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("ServicePeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServicePeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CustomerTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CustomerTenantId = (string) content.GetValueForProperty("CustomerTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CustomerTenantId, global::System.Convert.ToString); + } + if (content.Contains("CustomerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CustomerName = (string) content.GetValueForProperty("CustomerName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CustomerName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerTenantId = (string) content.GetValueForProperty("PartnerTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerTenantId, global::System.Convert.ToString); + } + if (content.Contains("PartnerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerName = (string) content.GetValueForProperty("PartnerName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerName, global::System.Convert.ToString); + } + if (content.Contains("ResellerMpnId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResellerMpnId = (string) content.GetValueForProperty("ResellerMpnId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResellerMpnId, global::System.Convert.ToString); + } + if (content.Contains("ResellerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResellerName = (string) content.GetValueForProperty("ResellerName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResellerName, global::System.Convert.ToString); + } + if (content.Contains("PublisherId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PublisherId = (string) content.GetValueForProperty("PublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PublisherId, global::System.Convert.ToString); + } + if (content.Contains("MarketPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MarketPrice = (decimal?) content.GetValueForProperty("MarketPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MarketPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExchangeRatePricingToBilling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ExchangeRatePricingToBilling = (decimal?) content.GetValueForProperty("ExchangeRatePricingToBilling",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ExchangeRatePricingToBilling, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PaygCostInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PaygCostInBillingCurrency = (decimal?) content.GetValueForProperty("PaygCostInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PaygCostInBillingCurrency, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PaygCostInUsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PaygCostInUsd = (decimal?) content.GetValueForProperty("PaygCostInUsd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PaygCostInUsd, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PartnerEarnedCreditRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerEarnedCreditRate = (decimal?) content.GetValueForProperty("PartnerEarnedCreditRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerEarnedCreditRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PartnerEarnedCreditApplied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerEarnedCreditApplied = (string) content.GetValueForProperty("PartnerEarnedCreditApplied",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerEarnedCreditApplied, global::System.Convert.ToString); + } + if (content.Contains("PayGPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PayGPrice = (decimal?) content.GetValueForProperty("PayGPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PayGPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BenefitId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BenefitId = (string) content.GetValueForProperty("BenefitId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BenefitId, global::System.Convert.ToString); + } + if (content.Contains("BenefitName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BenefitName = (string) content.GetValueForProperty("BenefitName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BenefitName, global::System.Convert.ToString); + } + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("CostAllocationRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostAllocationRuleName = (string) content.GetValueForProperty("CostAllocationRuleName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostAllocationRuleName, 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 ModernUsageDetail(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.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernUsageDetailPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind.CreateFrom); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("EffectivePrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).EffectivePrice = (decimal?) content.GetValueForProperty("EffectivePrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).EffectivePrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PricingModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PricingModel = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType?) content.GetValueForProperty("PricingModel",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PricingModel, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType.CreateFrom); + } + if (content.Contains("BillingAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingAccountName = (string) content.GetValueForProperty("BillingAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingAccountName, global::System.Convert.ToString); + } + if (content.Contains("BillingPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingPeriodStartDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingPeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingPeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingPeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingPeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingProfileName = (string) content.GetValueForProperty("BillingProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingProfileName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).SubscriptionGuid = (string) content.GetValueForProperty("SubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).SubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).SubscriptionName = (string) content.GetValueForProperty("SubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).SubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("Date")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Date = (global::System.DateTime?) content.GetValueForProperty("Date",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Date, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Product")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Product, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("MeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterName = (string) content.GetValueForProperty("MeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterRegion = (string) content.GetValueForProperty("MeterRegion",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterRegion, global::System.Convert.ToString); + } + if (content.Contains("MeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterCategory = (string) content.GetValueForProperty("MeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterSubCategory = (string) content.GetValueForProperty("MeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("ServiceFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServiceFamily = (string) content.GetValueForProperty("ServiceFamily",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServiceFamily, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).UnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("InstanceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InstanceName = (string) content.GetValueForProperty("InstanceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InstanceName, global::System.Convert.ToString); + } + if (content.Contains("CostInUsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostInUsd = (decimal?) content.GetValueForProperty("CostInUsd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostInUsd, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).UnitPrice = (decimal?) content.GetValueForProperty("UnitPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).UnitPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BillingCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingCurrencyCode = (string) content.GetValueForProperty("BillingCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BillingCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("ConsumedService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ConsumedService = (string) content.GetValueForProperty("ConsumedService",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ConsumedService, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServiceInfo1 = (string) content.GetValueForProperty("ServiceInfo1",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServiceInfo1, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServiceInfo2 = (string) content.GetValueForProperty("ServiceInfo2",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServiceInfo2, global::System.Convert.ToString); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InvoiceSectionId = (string) content.GetValueForProperty("InvoiceSectionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InvoiceSectionId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InvoiceSectionName = (string) content.GetValueForProperty("InvoiceSectionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InvoiceSectionName, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("ReservationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ReservationName = (string) content.GetValueForProperty("ReservationName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ReservationName, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ProductOrderId = (string) content.GetValueForProperty("ProductOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ProductOrderId, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ProductOrderName = (string) content.GetValueForProperty("ProductOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ProductOrderName, global::System.Convert.ToString); + } + if (content.Contains("IsAzureCreditEligible")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).IsAzureCreditEligible = (bool?) content.GetValueForProperty("IsAzureCreditEligible",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).IsAzureCreditEligible, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("PublisherName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PublisherName = (string) content.GetValueForProperty("PublisherName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PublisherName, global::System.Convert.ToString); + } + if (content.Contains("PublisherType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PublisherType = (string) content.GetValueForProperty("PublisherType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PublisherType, global::System.Convert.ToString); + } + if (content.Contains("ChargeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ChargeType = (string) content.GetValueForProperty("ChargeType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ChargeType, global::System.Convert.ToString); + } + if (content.Contains("Frequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Frequency = (string) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Frequency, global::System.Convert.ToString); + } + if (content.Contains("CostInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostInBillingCurrency = (decimal?) content.GetValueForProperty("CostInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostInBillingCurrency, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CostInPricingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostInPricingCurrency = (decimal?) content.GetValueForProperty("CostInPricingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostInPricingCurrency, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ExchangeRate = (string) content.GetValueForProperty("ExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ExchangeRate, global::System.Convert.ToString); + } + if (content.Contains("ExchangeRateDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ExchangeRateDate = (global::System.DateTime?) content.GetValueForProperty("ExchangeRateDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ExchangeRateDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).InvoiceId, global::System.Convert.ToString); + } + if (content.Contains("PreviousInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PreviousInvoiceId = (string) content.GetValueForProperty("PreviousInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PreviousInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("PricingCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PricingCurrencyCode = (string) content.GetValueForProperty("PricingCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PricingCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("ProductIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ProductIdentifier = (string) content.GetValueForProperty("ProductIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ProductIdentifier, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocationNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResourceLocationNormalized = (string) content.GetValueForProperty("ResourceLocationNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResourceLocationNormalized, global::System.Convert.ToString); + } + if (content.Contains("ServicePeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServicePeriodStartDate = (global::System.DateTime?) content.GetValueForProperty("ServicePeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServicePeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ServicePeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServicePeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("ServicePeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ServicePeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CustomerTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CustomerTenantId = (string) content.GetValueForProperty("CustomerTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CustomerTenantId, global::System.Convert.ToString); + } + if (content.Contains("CustomerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CustomerName = (string) content.GetValueForProperty("CustomerName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CustomerName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerTenantId = (string) content.GetValueForProperty("PartnerTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerTenantId, global::System.Convert.ToString); + } + if (content.Contains("PartnerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerName = (string) content.GetValueForProperty("PartnerName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerName, global::System.Convert.ToString); + } + if (content.Contains("ResellerMpnId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResellerMpnId = (string) content.GetValueForProperty("ResellerMpnId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResellerMpnId, global::System.Convert.ToString); + } + if (content.Contains("ResellerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResellerName = (string) content.GetValueForProperty("ResellerName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ResellerName, global::System.Convert.ToString); + } + if (content.Contains("PublisherId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PublisherId = (string) content.GetValueForProperty("PublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PublisherId, global::System.Convert.ToString); + } + if (content.Contains("MarketPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MarketPrice = (decimal?) content.GetValueForProperty("MarketPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).MarketPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExchangeRatePricingToBilling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ExchangeRatePricingToBilling = (decimal?) content.GetValueForProperty("ExchangeRatePricingToBilling",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).ExchangeRatePricingToBilling, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PaygCostInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PaygCostInBillingCurrency = (decimal?) content.GetValueForProperty("PaygCostInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PaygCostInBillingCurrency, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PaygCostInUsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PaygCostInUsd = (decimal?) content.GetValueForProperty("PaygCostInUsd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PaygCostInUsd, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PartnerEarnedCreditRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerEarnedCreditRate = (decimal?) content.GetValueForProperty("PartnerEarnedCreditRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerEarnedCreditRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PartnerEarnedCreditApplied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerEarnedCreditApplied = (string) content.GetValueForProperty("PartnerEarnedCreditApplied",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PartnerEarnedCreditApplied, global::System.Convert.ToString); + } + if (content.Contains("PayGPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PayGPrice = (decimal?) content.GetValueForProperty("PayGPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).PayGPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BenefitId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BenefitId = (string) content.GetValueForProperty("BenefitId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BenefitId, global::System.Convert.ToString); + } + if (content.Contains("BenefitName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BenefitName = (string) content.GetValueForProperty("BenefitName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).BenefitName, global::System.Convert.ToString); + } + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("CostAllocationRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostAllocationRuleName = (string) content.GetValueForProperty("CostAllocationRuleName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal)this).CostAllocationRuleName, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Modern usage detail. + [System.ComponentModel.TypeConverter(typeof(ModernUsageDetailTypeConverter))] + public partial interface IModernUsageDetail + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetail.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetail.TypeConverter.cs new file mode 100644 index 000000000000..acd8ea4c437c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetail.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ModernUsageDetailTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IModernUsageDetail ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetail).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ModernUsageDetail.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ModernUsageDetail.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ModernUsageDetail.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/consumption/generated/api/Models/Api20211001/ModernUsageDetail.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetail.cs new file mode 100644 index 000000000000..80bbc4028124 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetail.cs @@ -0,0 +1,1559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Modern usage detail. + public partial class ModernUsageDetail : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetail, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail __usageDetail = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.UsageDetail(); + + /// + /// Additional details of this usage item. Use this field to get usage line item specific details such as the actual VM Size + /// (ServiceType) or the ratio in which the reservation discount is applied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).AdditionalInfo; } + + /// Unique identifier for the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BenefitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BenefitId; } + + /// Name of the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BenefitName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BenefitName; } + + /// Billing Account identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingAccountId; } + + /// Name of the Billing Account. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingAccountName; } + + /// The currency defining the billed cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingCurrencyCode; } + + /// Billing Period End Date as in the invoice. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? BillingPeriodEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingPeriodEndDate; } + + /// Billing Period Start Date as in the invoice. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? BillingPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingPeriodStartDate; } + + /// + /// Identifier for the billing profile that groups costs across invoices in the a singular billing currency across across + /// the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases + /// like SaaS, Marketplace, RI, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingProfileId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingProfileId; } + + /// + /// Name of the billing profile that groups costs across invoices in the a singular billing currency across across the customers + /// who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like + /// SaaS, Marketplace, RI, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingProfileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingProfileName; } + + /// + /// Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ChargeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ChargeType; } + + /// + /// Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided + /// for marketplace usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ConsumedService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ConsumedService; } + + /// Name for Cost Allocation Rule. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CostAllocationRuleName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostAllocationRuleName; } + + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CostCenter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostCenter; } + + /// ExtendedCost or blended cost before tax in billed currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CostInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostInBillingCurrency; } + + /// + /// ExtendedCost or blended cost before tax in pricing currency to correlate with prices. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CostInPricingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostInPricingCurrency; } + + /// Estimated extendedCost or blended cost before tax in USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? CostInUsd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostInUsd; } + + /// Name of the customer's AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CustomerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CustomerName; } + + /// Identifier of the customer's AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CustomerTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CustomerTenantId; } + + /// Date for the usage record. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? Date { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Date; } + + /// Effective Price that's charged for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? EffectivePrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).EffectivePrice; } + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Etag; } + + /// Exchange rate used in conversion from pricing currency to billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ExchangeRate; } + + /// + /// Date on which exchange rate used in conversion from pricing currency to billing currency. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? ExchangeRateDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ExchangeRateDate; } + + /// Exchange Rate from pricing currency to billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ExchangeRatePricingToBilling { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ExchangeRatePricingToBilling; } + + /// + /// Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which + /// recur every month, and UsageBased for charges based on how much a service is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Frequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Frequency; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Id; } + + /// Instance Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InstanceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).InstanceName; } + + /// Invoice ID as on the invoice where the specific transaction appears. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).InvoiceId; } + + /// + /// Identifier of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded + /// by partners. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InvoiceSectionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).InvoiceSectionId; } + + /// + /// Name of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by + /// partners. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InvoiceSectionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).InvoiceSectionName; } + + /// Determines if the cost is eligible to be paid for using Azure credits. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public bool? IsAzureCreditEligible { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).IsAzureCreditEligible; } + + /// Specifies the kind of usage details. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)__usageDetail).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)__usageDetail).Kind = value ; } + + /// Market Price that's charged for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? MarketPrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MarketPrice; } + + /// Identifies the top-level service for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterCategory; } + + /// + /// The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which + /// the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterId; } + + /// Identifies the name of the meter against which consumption is measured. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterName; } + + /// + /// Identifies the location of the datacenter for certain services that are priced based on datacenter location. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterRegion; } + + /// Defines the type or sub-category of Azure service that can affect the rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterSubCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterSubCategory; } + + /// Internal Acessors for AdditionalInfo + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).AdditionalInfo = value; } + + /// Internal Acessors for BenefitId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.BenefitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BenefitId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BenefitId = value; } + + /// Internal Acessors for BenefitName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.BenefitName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BenefitName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BenefitName = value; } + + /// Internal Acessors for BillingAccountId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.BillingAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingAccountId = value; } + + /// Internal Acessors for BillingAccountName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.BillingAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingAccountName = value; } + + /// Internal Acessors for BillingCurrencyCode + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.BillingCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingCurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingCurrencyCode = value; } + + /// Internal Acessors for BillingPeriodEndDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.BillingPeriodEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingPeriodEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingPeriodEndDate = value; } + + /// Internal Acessors for BillingPeriodStartDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.BillingPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingPeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingPeriodStartDate = value; } + + /// Internal Acessors for BillingProfileId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.BillingProfileId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingProfileId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingProfileId = value; } + + /// Internal Acessors for BillingProfileName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.BillingProfileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingProfileName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).BillingProfileName = value; } + + /// Internal Acessors for ChargeType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ChargeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ChargeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ChargeType = value; } + + /// Internal Acessors for ConsumedService + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ConsumedService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ConsumedService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ConsumedService = value; } + + /// Internal Acessors for CostAllocationRuleName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.CostAllocationRuleName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostAllocationRuleName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostAllocationRuleName = value; } + + /// Internal Acessors for CostCenter + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.CostCenter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostCenter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostCenter = value; } + + /// Internal Acessors for CostInBillingCurrency + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.CostInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostInBillingCurrency = value; } + + /// Internal Acessors for CostInPricingCurrency + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.CostInPricingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostInPricingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostInPricingCurrency = value; } + + /// Internal Acessors for CostInUsd + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.CostInUsd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostInUsd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CostInUsd = value; } + + /// Internal Acessors for CustomerName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.CustomerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CustomerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CustomerName = value; } + + /// Internal Acessors for CustomerTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.CustomerTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CustomerTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).CustomerTenantId = value; } + + /// Internal Acessors for Date + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.Date { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Date; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Date = value; } + + /// Internal Acessors for EffectivePrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.EffectivePrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).EffectivePrice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).EffectivePrice = value; } + + /// Internal Acessors for ExchangeRate + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ExchangeRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ExchangeRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ExchangeRate = value; } + + /// Internal Acessors for ExchangeRateDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ExchangeRateDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ExchangeRateDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ExchangeRateDate = value; } + + /// Internal Acessors for ExchangeRatePricingToBilling + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ExchangeRatePricingToBilling { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ExchangeRatePricingToBilling; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ExchangeRatePricingToBilling = value; } + + /// Internal Acessors for Frequency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.Frequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Frequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Frequency = value; } + + /// Internal Acessors for InstanceName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.InstanceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).InstanceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).InstanceName = value; } + + /// Internal Acessors for InvoiceId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.InvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).InvoiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).InvoiceId = value; } + + /// Internal Acessors for InvoiceSectionId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.InvoiceSectionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).InvoiceSectionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).InvoiceSectionId = value; } + + /// Internal Acessors for InvoiceSectionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.InvoiceSectionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).InvoiceSectionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).InvoiceSectionName = value; } + + /// Internal Acessors for IsAzureCreditEligible + bool? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.IsAzureCreditEligible { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).IsAzureCreditEligible; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).IsAzureCreditEligible = value; } + + /// Internal Acessors for MarketPrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.MarketPrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MarketPrice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MarketPrice = value; } + + /// Internal Acessors for MeterCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.MeterCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterCategory = value; } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.MeterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterId = value; } + + /// Internal Acessors for MeterName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.MeterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterName = value; } + + /// Internal Acessors for MeterRegion + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.MeterRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterRegion = value; } + + /// Internal Acessors for MeterSubCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.MeterSubCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterSubCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).MeterSubCategory = value; } + + /// Internal Acessors for PartnerEarnedCreditApplied + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PartnerEarnedCreditApplied { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PartnerEarnedCreditApplied; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PartnerEarnedCreditApplied = value; } + + /// Internal Acessors for PartnerEarnedCreditRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PartnerEarnedCreditRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PartnerEarnedCreditRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PartnerEarnedCreditRate = value; } + + /// Internal Acessors for PartnerName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PartnerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PartnerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PartnerName = value; } + + /// Internal Acessors for PartnerTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PartnerTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PartnerTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PartnerTenantId = value; } + + /// Internal Acessors for PayGPrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PayGPrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PayGPrice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PayGPrice = value; } + + /// Internal Acessors for PaygCostInBillingCurrency + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PaygCostInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PaygCostInBillingCurrency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PaygCostInBillingCurrency = value; } + + /// Internal Acessors for PaygCostInUsd + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PaygCostInUsd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PaygCostInUsd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PaygCostInUsd = value; } + + /// Internal Acessors for PreviousInvoiceId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PreviousInvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PreviousInvoiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PreviousInvoiceId = value; } + + /// Internal Acessors for PricingCurrencyCode + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PricingCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PricingCurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PricingCurrencyCode = value; } + + /// Internal Acessors for PricingModel + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PricingModel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PricingModel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PricingModel = value; } + + /// Internal Acessors for Product + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.Product { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Product; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Product = value; } + + /// Internal Acessors for ProductIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ProductIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ProductIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ProductIdentifier = value; } + + /// Internal Acessors for ProductOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ProductOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ProductOrderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ProductOrderId = value; } + + /// Internal Acessors for ProductOrderName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ProductOrderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ProductOrderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ProductOrderName = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernUsageDetailProperties()); set { {_property = value;} } } + + /// Internal Acessors for Provider + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.Provider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Provider = value; } + + /// Internal Acessors for PublisherId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PublisherId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PublisherId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PublisherId = value; } + + /// Internal Acessors for PublisherName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PublisherName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PublisherName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PublisherName = value; } + + /// Internal Acessors for PublisherType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.PublisherType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PublisherType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PublisherType = value; } + + /// Internal Acessors for Quantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Quantity = value; } + + /// Internal Acessors for ResellerMpnId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ResellerMpnId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResellerMpnId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResellerMpnId = value; } + + /// Internal Acessors for ResellerName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ResellerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResellerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResellerName = value; } + + /// Internal Acessors for ReservationId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ReservationId = value; } + + /// Internal Acessors for ReservationName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ReservationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ReservationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ReservationName = value; } + + /// Internal Acessors for ResourceGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResourceGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResourceGroup = value; } + + /// Internal Acessors for ResourceLocation + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResourceLocation = value; } + + /// Internal Acessors for ResourceLocationNormalized + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ResourceLocationNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResourceLocationNormalized; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResourceLocationNormalized = value; } + + /// Internal Acessors for ServiceFamily + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ServiceFamily { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServiceFamily; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServiceFamily = value; } + + /// Internal Acessors for ServiceInfo1 + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ServiceInfo1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServiceInfo1; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServiceInfo1 = value; } + + /// Internal Acessors for ServiceInfo2 + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ServiceInfo2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServiceInfo2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServiceInfo2 = value; } + + /// Internal Acessors for ServicePeriodEndDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ServicePeriodEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServicePeriodEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServicePeriodEndDate = value; } + + /// Internal Acessors for ServicePeriodStartDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.ServicePeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServicePeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServicePeriodStartDate = value; } + + /// Internal Acessors for SubscriptionGuid + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.SubscriptionGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).SubscriptionGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).SubscriptionGuid = value; } + + /// Internal Acessors for SubscriptionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.SubscriptionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).SubscriptionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).SubscriptionName = value; } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Term = value; } + + /// Internal Acessors for UnitOfMeasure + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.UnitOfMeasure { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).UnitOfMeasure; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).UnitOfMeasure = value; } + + /// Internal Acessors for UnitPrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailInternal.UnitPrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).UnitPrice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).UnitPrice = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Name; } + + /// Flag to indicate if partner earned credit has been applied or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PartnerEarnedCreditApplied { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PartnerEarnedCreditApplied; } + + /// + /// Rate of discount applied if there is a partner earned credit (PEC) based on partner admin link access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? PartnerEarnedCreditRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PartnerEarnedCreditRate; } + + /// Name of the partner' AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PartnerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PartnerName; } + + /// Identifier for the partner's AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PartnerTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PartnerTenantId; } + + /// Retail price for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? PayGPrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PayGPrice; } + + /// The amount of PayG cost before tax in billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? PaygCostInBillingCurrency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PaygCostInBillingCurrency; } + + /// The amount of PayG cost before tax in US Dollar currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? PaygCostInUsd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PaygCostInUsd; } + + /// + /// Reference to an original invoice there is a refund (negative cost). This is populated only when there is a refund. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PreviousInvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PreviousInvoiceId; } + + /// Pricing Billing Currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PricingCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PricingCurrencyCode; } + + /// Identifier that indicates how the meter is priced + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? PricingModel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PricingModel; } + + /// + /// Name of the product that has accrued charges by consumption or purchase as listed in the invoice. Not available for Marketplace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Product { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Product; } + + /// + /// Identifier for the product that has accrued charges by consumption or purchase . This is the concatenated key of productId + /// and SkuId in partner center. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ProductIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ProductIdentifier; } + + /// + /// The identifier for the asset or Azure plan name that the subscription belongs to. For example: Azure Plan. For reservations + /// this is the Reservation Order ID. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ProductOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ProductOrderId; } + + /// Product Order Name. For reservations this is the SKU that was purchased. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ProductOrderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ProductOrderName; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailProperties _property; + + /// Properties for modern usage details + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernUsageDetailProperties()); set => this._property = value; } + + /// + /// Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS e.t.c + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Provider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Provider; } + + /// Publisher Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PublisherId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PublisherId; } + + /// + /// Name of the publisher of the service including Microsoft or Third Party publishers. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PublisherName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PublisherName; } + + /// + /// Type of publisher that identifies if the publisher is first party, third party reseller or third party agency. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PublisherType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).PublisherType; } + + /// + /// Measure the quantity purchased or consumed.The amount of the meter used during the billing period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Quantity; } + + /// MPNId for the reseller associated with the subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerMpnId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResellerMpnId; } + + /// Reseller Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResellerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResellerName; } + + /// + /// ARM resource id of the reservation. Only applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ReservationId; } + + /// + /// User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only + /// applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ReservationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ReservationName; } + + /// + /// Name of the Azure resource group used for cohesive lifecycle management of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResourceGroup; } + + /// Name of the resource location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResourceLocation; } + + /// Resource Location Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceLocationNormalized { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ResourceLocationNormalized; } + + /// + /// List the service family for the product purchased or charged (Example: Storage ; Compute). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ServiceFamily { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServiceFamily; } + + /// Service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ServiceInfo1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServiceInfo1; } + + /// Legacy field with optional service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ServiceInfo2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServiceInfo2; } + + /// + /// End date for the period when the service usage was rated for charges. The prices for Azure services are determined based + /// on the rating period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? ServicePeriodEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServicePeriodEndDate; } + + /// + /// Start date for the rating period when the service usage was rated for charges. The prices for Azure services are determined + /// for the rating period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? ServicePeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).ServicePeriodStartDate; } + + /// Unique Microsoft generated identifier for the Azure Subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SubscriptionGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).SubscriptionGuid; } + + /// Name of the Azure Subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SubscriptionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).SubscriptionName; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Tag; } + + /// + /// Term (in months). Displays the term for the validity of the offer. For example. In case of reserved instances it displays + /// 12 months for yearly term of reserved instance. For one time purchases or recurring purchases, the terms displays 1 month; + /// This is not applicable for Azure consumption. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).Term; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__usageDetail).Type; } + + /// + /// Identifies the Unit that the service is charged in. For example, GB, hours, 10,000 s. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UnitOfMeasure { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).UnitOfMeasure; } + + /// Unit Price is the price applicable to you. (your EA or other contract price). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? UnitPrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)Property).UnitPrice; } + + /// Creates an new instance. + public ModernUsageDetail() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__usageDetail), __usageDetail); + await eventListener.AssertObjectIsValid(nameof(__usageDetail), __usageDetail); + } + } + /// Modern usage detail. + public partial interface IModernUsageDetail : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail + { + /// + /// Additional details of this usage item. Use this field to get usage line item specific details such as the actual VM Size + /// (ServiceType) or the ratio in which the reservation discount is applied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Additional details of this usage item. Use this field to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation discount is applied.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(string) })] + string AdditionalInfo { get; } + /// Unique identifier for the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unique identifier for the applicable benefit.", + SerializedName = @"benefitId", + PossibleTypes = new [] { typeof(string) })] + string BenefitId { get; } + /// Name of the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the applicable benefit.", + SerializedName = @"benefitName", + PossibleTypes = new [] { typeof(string) })] + string BenefitName { get; } + /// Billing Account identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Account identifier.", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + string BillingAccountId { get; } + /// Name of the Billing Account. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the Billing Account.", + SerializedName = @"billingAccountName", + PossibleTypes = new [] { typeof(string) })] + string BillingAccountName { get; } + /// The currency defining the billed cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The currency defining the billed cost.", + SerializedName = @"billingCurrencyCode", + PossibleTypes = new [] { typeof(string) })] + string BillingCurrencyCode { get; } + /// Billing Period End Date as in the invoice. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Period End Date as in the invoice.", + SerializedName = @"billingPeriodEndDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BillingPeriodEndDate { get; } + /// Billing Period Start Date as in the invoice. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Period Start Date as in the invoice.", + SerializedName = @"billingPeriodStartDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BillingPeriodStartDate { get; } + /// + /// Identifier for the billing profile that groups costs across invoices in the a singular billing currency across across + /// the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases + /// like SaaS, Marketplace, RI, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier for the billing profile that groups costs across invoices in the a singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc.", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileId { get; } + /// + /// Name of the billing profile that groups costs across invoices in the a singular billing currency across across the customers + /// who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like + /// SaaS, Marketplace, RI, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the billing profile that groups costs across invoices in the a singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc.", + SerializedName = @"billingProfileName", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileName { get; } + /// + /// Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund.", + SerializedName = @"chargeType", + PossibleTypes = new [] { typeof(string) })] + string ChargeType { get; } + /// + /// Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided + /// for marketplace usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided for marketplace usage.", + SerializedName = @"consumedService", + PossibleTypes = new [] { typeof(string) })] + string ConsumedService { get; } + /// Name for Cost Allocation Rule. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name for Cost Allocation Rule.", + SerializedName = @"costAllocationRuleName", + PossibleTypes = new [] { typeof(string) })] + string CostAllocationRuleName { get; } + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The cost center of this department if it is a department and a cost center is provided.", + SerializedName = @"costCenter", + PossibleTypes = new [] { typeof(string) })] + string CostCenter { get; } + /// ExtendedCost or blended cost before tax in billed currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ExtendedCost or blended cost before tax in billed currency.", + SerializedName = @"costInBillingCurrency", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CostInBillingCurrency { get; } + /// + /// ExtendedCost or blended cost before tax in pricing currency to correlate with prices. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ExtendedCost or blended cost before tax in pricing currency to correlate with prices.", + SerializedName = @"costInPricingCurrency", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CostInPricingCurrency { get; } + /// Estimated extendedCost or blended cost before tax in USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Estimated extendedCost or blended cost before tax in USD.", + SerializedName = @"costInUSD", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CostInUsd { get; } + /// Name of the customer's AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the customer's AAD tenant.", + SerializedName = @"customerName", + PossibleTypes = new [] { typeof(string) })] + string CustomerName { get; } + /// Identifier of the customer's AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier of the customer's AAD tenant.", + SerializedName = @"customerTenantId", + PossibleTypes = new [] { typeof(string) })] + string CustomerTenantId { get; } + /// Date for the usage record. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date for the usage record.", + SerializedName = @"date", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Date { get; } + /// Effective Price that's charged for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Effective Price that's charged for the usage.", + SerializedName = @"effectivePrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EffectivePrice { get; } + /// Exchange rate used in conversion from pricing currency to billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Exchange rate used in conversion from pricing currency to billing currency.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(string) })] + string ExchangeRate { get; } + /// + /// Date on which exchange rate used in conversion from pricing currency to billing currency. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date on which exchange rate used in conversion from pricing currency to billing currency.", + SerializedName = @"exchangeRateDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExchangeRateDate { get; } + /// Exchange Rate from pricing currency to billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Exchange Rate from pricing currency to billing currency.", + SerializedName = @"exchangeRatePricingToBilling", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ExchangeRatePricingToBilling { get; } + /// + /// Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which + /// recur every month, and UsageBased for charges based on how much a service is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is used.", + SerializedName = @"frequency", + PossibleTypes = new [] { typeof(string) })] + string Frequency { get; } + /// Instance Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Instance Name.", + SerializedName = @"instanceName", + PossibleTypes = new [] { typeof(string) })] + string InstanceName { get; } + /// Invoice ID as on the invoice where the specific transaction appears. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice ID as on the invoice where the specific transaction appears.", + SerializedName = @"invoiceId", + PossibleTypes = new [] { typeof(string) })] + string InvoiceId { get; } + /// + /// Identifier of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded + /// by partners. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by partners.", + SerializedName = @"invoiceSectionId", + PossibleTypes = new [] { typeof(string) })] + string InvoiceSectionId { get; } + /// + /// Name of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by + /// partners. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by partners.", + SerializedName = @"invoiceSectionName", + PossibleTypes = new [] { typeof(string) })] + string InvoiceSectionName { get; } + /// Determines if the cost is eligible to be paid for using Azure credits. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Determines if the cost is eligible to be paid for using Azure credits.", + SerializedName = @"isAzureCreditEligible", + PossibleTypes = new [] { typeof(bool) })] + bool? IsAzureCreditEligible { get; } + /// Market Price that's charged for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Market Price that's charged for the usage.", + SerializedName = @"marketPrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MarketPrice { get; } + /// Identifies the top-level service for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifies the top-level service for the usage.", + SerializedName = @"meterCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterCategory { get; } + /// + /// The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which + /// the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName.", + SerializedName = @"meterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// Identifies the name of the meter against which consumption is measured. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifies the name of the meter against which consumption is measured.", + SerializedName = @"meterName", + PossibleTypes = new [] { typeof(string) })] + string MeterName { get; } + /// + /// Identifies the location of the datacenter for certain services that are priced based on datacenter location. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifies the location of the datacenter for certain services that are priced based on datacenter location.", + SerializedName = @"meterRegion", + PossibleTypes = new [] { typeof(string) })] + string MeterRegion { get; } + /// Defines the type or sub-category of Azure service that can affect the rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Defines the type or sub-category of Azure service that can affect the rate.", + SerializedName = @"meterSubCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterSubCategory { get; } + /// Flag to indicate if partner earned credit has been applied or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Flag to indicate if partner earned credit has been applied or not.", + SerializedName = @"partnerEarnedCreditApplied", + PossibleTypes = new [] { typeof(string) })] + string PartnerEarnedCreditApplied { get; } + /// + /// Rate of discount applied if there is a partner earned credit (PEC) based on partner admin link access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Rate of discount applied if there is a partner earned credit (PEC) based on partner admin link access.", + SerializedName = @"partnerEarnedCreditRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PartnerEarnedCreditRate { get; } + /// Name of the partner' AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the partner' AAD tenant.", + SerializedName = @"partnerName", + PossibleTypes = new [] { typeof(string) })] + string PartnerName { get; } + /// Identifier for the partner's AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier for the partner's AAD tenant.", + SerializedName = @"partnerTenantId", + PossibleTypes = new [] { typeof(string) })] + string PartnerTenantId { get; } + /// Retail price for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Retail price for the resource.", + SerializedName = @"payGPrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PayGPrice { get; } + /// The amount of PayG cost before tax in billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The amount of PayG cost before tax in billing currency.", + SerializedName = @"paygCostInBillingCurrency", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PaygCostInBillingCurrency { get; } + /// The amount of PayG cost before tax in US Dollar currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The amount of PayG cost before tax in US Dollar currency.", + SerializedName = @"paygCostInUSD", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PaygCostInUsd { get; } + /// + /// Reference to an original invoice there is a refund (negative cost). This is populated only when there is a refund. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reference to an original invoice there is a refund (negative cost). This is populated only when there is a refund.", + SerializedName = @"previousInvoiceId", + PossibleTypes = new [] { typeof(string) })] + string PreviousInvoiceId { get; } + /// Pricing Billing Currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Pricing Billing Currency.", + SerializedName = @"pricingCurrencyCode", + PossibleTypes = new [] { typeof(string) })] + string PricingCurrencyCode { get; } + /// Identifier that indicates how the meter is priced + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier that indicates how the meter is priced", + SerializedName = @"pricingModel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? PricingModel { get; } + /// + /// Name of the product that has accrued charges by consumption or purchase as listed in the invoice. Not available for Marketplace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the product that has accrued charges by consumption or purchase as listed in the invoice. Not available for Marketplace.", + SerializedName = @"product", + PossibleTypes = new [] { typeof(string) })] + string Product { get; } + /// + /// Identifier for the product that has accrued charges by consumption or purchase . This is the concatenated key of productId + /// and SkuId in partner center. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier for the product that has accrued charges by consumption or purchase . This is the concatenated key of productId and SkuId in partner center.", + SerializedName = @"productIdentifier", + PossibleTypes = new [] { typeof(string) })] + string ProductIdentifier { get; } + /// + /// The identifier for the asset or Azure plan name that the subscription belongs to. For example: Azure Plan. For reservations + /// this is the Reservation Order ID. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The identifier for the asset or Azure plan name that the subscription belongs to. For example: Azure Plan. For reservations this is the Reservation Order ID.", + SerializedName = @"productOrderId", + PossibleTypes = new [] { typeof(string) })] + string ProductOrderId { get; } + /// Product Order Name. For reservations this is the SKU that was purchased. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Product Order Name. For reservations this is the SKU that was purchased.", + SerializedName = @"productOrderName", + PossibleTypes = new [] { typeof(string) })] + string ProductOrderName { get; } + /// + /// Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS e.t.c + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS e.t.c", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; } + /// Publisher Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Publisher Id.", + SerializedName = @"publisherId", + PossibleTypes = new [] { typeof(string) })] + string PublisherId { get; } + /// + /// Name of the publisher of the service including Microsoft or Third Party publishers. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the publisher of the service including Microsoft or Third Party publishers.", + SerializedName = @"publisherName", + PossibleTypes = new [] { typeof(string) })] + string PublisherName { get; } + /// + /// Type of publisher that identifies if the publisher is first party, third party reseller or third party agency. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of publisher that identifies if the publisher is first party, third party reseller or third party agency.", + SerializedName = @"publisherType", + PossibleTypes = new [] { typeof(string) })] + string PublisherType { get; } + /// + /// Measure the quantity purchased or consumed.The amount of the meter used during the billing period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Measure the quantity purchased or consumed.The amount of the meter used during the billing period.", + SerializedName = @"quantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Quantity { get; } + /// MPNId for the reseller associated with the subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"MPNId for the reseller associated with the subscription.", + SerializedName = @"resellerMpnId", + PossibleTypes = new [] { typeof(string) })] + string ResellerMpnId { get; } + /// Reseller Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reseller Name.", + SerializedName = @"resellerName", + PossibleTypes = new [] { typeof(string) })] + string ResellerName { get; } + /// + /// ARM resource id of the reservation. Only applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ARM resource id of the reservation. Only applies to records relevant to reservations.", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + string ReservationId { get; } + /// + /// User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only + /// applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only applies to records relevant to reservations.", + SerializedName = @"reservationName", + PossibleTypes = new [] { typeof(string) })] + string ReservationName { get; } + /// + /// Name of the Azure resource group used for cohesive lifecycle management of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the Azure resource group used for cohesive lifecycle management of resources.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; } + /// Name of the resource location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the resource location.", + SerializedName = @"resourceLocation", + PossibleTypes = new [] { typeof(string) })] + string ResourceLocation { get; } + /// Resource Location Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Location Normalized.", + SerializedName = @"resourceLocationNormalized", + PossibleTypes = new [] { typeof(string) })] + string ResourceLocationNormalized { get; } + /// + /// List the service family for the product purchased or charged (Example: Storage ; Compute). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List the service family for the product purchased or charged (Example: Storage ; Compute).", + SerializedName = @"serviceFamily", + PossibleTypes = new [] { typeof(string) })] + string ServiceFamily { get; } + /// Service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service-specific metadata.", + SerializedName = @"serviceInfo1", + PossibleTypes = new [] { typeof(string) })] + string ServiceInfo1 { get; } + /// Legacy field with optional service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Legacy field with optional service-specific metadata.", + SerializedName = @"serviceInfo2", + PossibleTypes = new [] { typeof(string) })] + string ServiceInfo2 { get; } + /// + /// End date for the period when the service usage was rated for charges. The prices for Azure services are determined based + /// on the rating period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"End date for the period when the service usage was rated for charges. The prices for Azure services are determined based on the rating period.", + SerializedName = @"servicePeriodEndDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ServicePeriodEndDate { get; } + /// + /// Start date for the rating period when the service usage was rated for charges. The prices for Azure services are determined + /// for the rating period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Start date for the rating period when the service usage was rated for charges. The prices for Azure services are determined for the rating period.", + SerializedName = @"servicePeriodStartDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ServicePeriodStartDate { get; } + /// Unique Microsoft generated identifier for the Azure Subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unique Microsoft generated identifier for the Azure Subscription.", + SerializedName = @"subscriptionGuid", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionGuid { get; } + /// Name of the Azure Subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the Azure Subscription.", + SerializedName = @"subscriptionName", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionName { get; } + /// + /// Term (in months). Displays the term for the validity of the offer. For example. In case of reserved instances it displays + /// 12 months for yearly term of reserved instance. For one time purchases or recurring purchases, the terms displays 1 month; + /// This is not applicable for Azure consumption. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Term (in months). Displays the term for the validity of the offer. For example. In case of reserved instances it displays 12 months for yearly term of reserved instance. For one time purchases or recurring purchases, the terms displays 1 month; This is not applicable for Azure consumption.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(string) })] + string Term { get; } + /// + /// Identifies the Unit that the service is charged in. For example, GB, hours, 10,000 s. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifies the Unit that the service is charged in. For example, GB, hours, 10,000 s.", + SerializedName = @"unitOfMeasure", + PossibleTypes = new [] { typeof(string) })] + string UnitOfMeasure { get; } + /// Unit Price is the price applicable to you. (your EA or other contract price). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unit Price is the price applicable to you. (your EA or other contract price).", + SerializedName = @"unitPrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UnitPrice { get; } + + } + /// Modern usage detail. + internal partial interface IModernUsageDetailInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal + { + /// + /// Additional details of this usage item. Use this field to get usage line item specific details such as the actual VM Size + /// (ServiceType) or the ratio in which the reservation discount is applied. + /// + string AdditionalInfo { get; set; } + /// Unique identifier for the applicable benefit. + string BenefitId { get; set; } + /// Name of the applicable benefit. + string BenefitName { get; set; } + /// Billing Account identifier. + string BillingAccountId { get; set; } + /// Name of the Billing Account. + string BillingAccountName { get; set; } + /// The currency defining the billed cost. + string BillingCurrencyCode { get; set; } + /// Billing Period End Date as in the invoice. + global::System.DateTime? BillingPeriodEndDate { get; set; } + /// Billing Period Start Date as in the invoice. + global::System.DateTime? BillingPeriodStartDate { get; set; } + /// + /// Identifier for the billing profile that groups costs across invoices in the a singular billing currency across across + /// the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases + /// like SaaS, Marketplace, RI, etc. + /// + string BillingProfileId { get; set; } + /// + /// Name of the billing profile that groups costs across invoices in the a singular billing currency across across the customers + /// who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like + /// SaaS, Marketplace, RI, etc. + /// + string BillingProfileName { get; set; } + /// + /// Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + /// + string ChargeType { get; set; } + /// + /// Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided + /// for marketplace usage. + /// + string ConsumedService { get; set; } + /// Name for Cost Allocation Rule. + string CostAllocationRuleName { get; set; } + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + string CostCenter { get; set; } + /// ExtendedCost or blended cost before tax in billed currency. + decimal? CostInBillingCurrency { get; set; } + /// + /// ExtendedCost or blended cost before tax in pricing currency to correlate with prices. + /// + decimal? CostInPricingCurrency { get; set; } + /// Estimated extendedCost or blended cost before tax in USD. + decimal? CostInUsd { get; set; } + /// Name of the customer's AAD tenant. + string CustomerName { get; set; } + /// Identifier of the customer's AAD tenant. + string CustomerTenantId { get; set; } + /// Date for the usage record. + global::System.DateTime? Date { get; set; } + /// Effective Price that's charged for the usage. + decimal? EffectivePrice { get; set; } + /// Exchange rate used in conversion from pricing currency to billing currency. + string ExchangeRate { get; set; } + /// + /// Date on which exchange rate used in conversion from pricing currency to billing currency. + /// + global::System.DateTime? ExchangeRateDate { get; set; } + /// Exchange Rate from pricing currency to billing currency. + decimal? ExchangeRatePricingToBilling { get; set; } + /// + /// Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which + /// recur every month, and UsageBased for charges based on how much a service is used. + /// + string Frequency { get; set; } + /// Instance Name. + string InstanceName { get; set; } + /// Invoice ID as on the invoice where the specific transaction appears. + string InvoiceId { get; set; } + /// + /// Identifier of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded + /// by partners. + /// + string InvoiceSectionId { get; set; } + /// + /// Name of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by + /// partners. + /// + string InvoiceSectionName { get; set; } + /// Determines if the cost is eligible to be paid for using Azure credits. + bool? IsAzureCreditEligible { get; set; } + /// Market Price that's charged for the usage. + decimal? MarketPrice { get; set; } + /// Identifies the top-level service for the usage. + string MeterCategory { get; set; } + /// + /// The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which + /// the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + /// + string MeterId { get; set; } + /// Identifies the name of the meter against which consumption is measured. + string MeterName { get; set; } + /// + /// Identifies the location of the datacenter for certain services that are priced based on datacenter location. + /// + string MeterRegion { get; set; } + /// Defines the type or sub-category of Azure service that can affect the rate. + string MeterSubCategory { get; set; } + /// Flag to indicate if partner earned credit has been applied or not. + string PartnerEarnedCreditApplied { get; set; } + /// + /// Rate of discount applied if there is a partner earned credit (PEC) based on partner admin link access. + /// + decimal? PartnerEarnedCreditRate { get; set; } + /// Name of the partner' AAD tenant. + string PartnerName { get; set; } + /// Identifier for the partner's AAD tenant. + string PartnerTenantId { get; set; } + /// Retail price for the resource. + decimal? PayGPrice { get; set; } + /// The amount of PayG cost before tax in billing currency. + decimal? PaygCostInBillingCurrency { get; set; } + /// The amount of PayG cost before tax in US Dollar currency. + decimal? PaygCostInUsd { get; set; } + /// + /// Reference to an original invoice there is a refund (negative cost). This is populated only when there is a refund. + /// + string PreviousInvoiceId { get; set; } + /// Pricing Billing Currency. + string PricingCurrencyCode { get; set; } + /// Identifier that indicates how the meter is priced + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? PricingModel { get; set; } + /// + /// Name of the product that has accrued charges by consumption or purchase as listed in the invoice. Not available for Marketplace. + /// + string Product { get; set; } + /// + /// Identifier for the product that has accrued charges by consumption or purchase . This is the concatenated key of productId + /// and SkuId in partner center. + /// + string ProductIdentifier { get; set; } + /// + /// The identifier for the asset or Azure plan name that the subscription belongs to. For example: Azure Plan. For reservations + /// this is the Reservation Order ID. + /// + string ProductOrderId { get; set; } + /// Product Order Name. For reservations this is the SKU that was purchased. + string ProductOrderName { get; set; } + /// Properties for modern usage details + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailProperties Property { get; set; } + /// + /// Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS e.t.c + /// + string Provider { get; set; } + /// Publisher Id. + string PublisherId { get; set; } + /// + /// Name of the publisher of the service including Microsoft or Third Party publishers. + /// + string PublisherName { get; set; } + /// + /// Type of publisher that identifies if the publisher is first party, third party reseller or third party agency. + /// + string PublisherType { get; set; } + /// + /// Measure the quantity purchased or consumed.The amount of the meter used during the billing period. + /// + decimal? Quantity { get; set; } + /// MPNId for the reseller associated with the subscription. + string ResellerMpnId { get; set; } + /// Reseller Name. + string ResellerName { get; set; } + /// + /// ARM resource id of the reservation. Only applies to records relevant to reservations. + /// + string ReservationId { get; set; } + /// + /// User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only + /// applies to records relevant to reservations. + /// + string ReservationName { get; set; } + /// + /// Name of the Azure resource group used for cohesive lifecycle management of resources. + /// + string ResourceGroup { get; set; } + /// Name of the resource location. + string ResourceLocation { get; set; } + /// Resource Location Normalized. + string ResourceLocationNormalized { get; set; } + /// + /// List the service family for the product purchased or charged (Example: Storage ; Compute). + /// + string ServiceFamily { get; set; } + /// Service-specific metadata. + string ServiceInfo1 { get; set; } + /// Legacy field with optional service-specific metadata. + string ServiceInfo2 { get; set; } + /// + /// End date for the period when the service usage was rated for charges. The prices for Azure services are determined based + /// on the rating period. + /// + global::System.DateTime? ServicePeriodEndDate { get; set; } + /// + /// Start date for the rating period when the service usage was rated for charges. The prices for Azure services are determined + /// for the rating period. + /// + global::System.DateTime? ServicePeriodStartDate { get; set; } + /// Unique Microsoft generated identifier for the Azure Subscription. + string SubscriptionGuid { get; set; } + /// Name of the Azure Subscription. + string SubscriptionName { get; set; } + /// + /// Term (in months). Displays the term for the validity of the offer. For example. In case of reserved instances it displays + /// 12 months for yearly term of reserved instance. For one time purchases or recurring purchases, the terms displays 1 month; + /// This is not applicable for Azure consumption. + /// + string Term { get; set; } + /// + /// Identifies the Unit that the service is charged in. For example, GB, hours, 10,000 s. + /// + string UnitOfMeasure { get; set; } + /// Unit Price is the price applicable to you. (your EA or other contract price). + decimal? UnitPrice { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetail.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetail.json.cs new file mode 100644 index 000000000000..feeded098cc2 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetail.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Modern usage detail. + public partial class ModernUsageDetail + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetail. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ModernUsageDetail(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ModernUsageDetail(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __usageDetail = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.UsageDetail(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ModernUsageDetailProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __usageDetail?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ModernUsageDetailProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetailProperties.PowerShell.cs new file mode 100644 index 000000000000..9fc79f60cbe0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetailProperties.PowerShell.cs @@ -0,0 +1,714 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the usage detail. + [System.ComponentModel.TypeConverter(typeof(ModernUsageDetailPropertiesTypeConverter))] + public partial class ModernUsageDetailProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IModernUsageDetailProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ModernUsageDetailProperties(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.Consumption.Models.Api20211001.IModernUsageDetailProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ModernUsageDetailProperties(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.Consumption.Models.Api20211001.IModernUsageDetailProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ModernUsageDetailProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("EffectivePrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).EffectivePrice = (decimal?) content.GetValueForProperty("EffectivePrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).EffectivePrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PricingModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PricingModel = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType?) content.GetValueForProperty("PricingModel",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PricingModel, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType.CreateFrom); + } + if (content.Contains("BillingAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingAccountName = (string) content.GetValueForProperty("BillingAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingAccountName, global::System.Convert.ToString); + } + if (content.Contains("BillingPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingPeriodStartDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingPeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingPeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingPeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingPeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingProfileName = (string) content.GetValueForProperty("BillingProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingProfileName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).SubscriptionGuid = (string) content.GetValueForProperty("SubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).SubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).SubscriptionName = (string) content.GetValueForProperty("SubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).SubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("Date")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Date = (global::System.DateTime?) content.GetValueForProperty("Date",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Date, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Product")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Product, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("MeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterName = (string) content.GetValueForProperty("MeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterRegion = (string) content.GetValueForProperty("MeterRegion",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterRegion, global::System.Convert.ToString); + } + if (content.Contains("MeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterCategory = (string) content.GetValueForProperty("MeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterSubCategory = (string) content.GetValueForProperty("MeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("ServiceFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServiceFamily = (string) content.GetValueForProperty("ServiceFamily",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServiceFamily, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).UnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("InstanceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InstanceName = (string) content.GetValueForProperty("InstanceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InstanceName, global::System.Convert.ToString); + } + if (content.Contains("CostInUsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostInUsd = (decimal?) content.GetValueForProperty("CostInUsd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostInUsd, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).UnitPrice = (decimal?) content.GetValueForProperty("UnitPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).UnitPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BillingCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingCurrencyCode = (string) content.GetValueForProperty("BillingCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("ConsumedService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ConsumedService = (string) content.GetValueForProperty("ConsumedService",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ConsumedService, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServiceInfo1 = (string) content.GetValueForProperty("ServiceInfo1",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServiceInfo1, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServiceInfo2 = (string) content.GetValueForProperty("ServiceInfo2",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServiceInfo2, global::System.Convert.ToString); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InvoiceSectionId = (string) content.GetValueForProperty("InvoiceSectionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InvoiceSectionId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InvoiceSectionName = (string) content.GetValueForProperty("InvoiceSectionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InvoiceSectionName, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("ReservationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ReservationName = (string) content.GetValueForProperty("ReservationName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ReservationName, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ProductOrderId = (string) content.GetValueForProperty("ProductOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ProductOrderId, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ProductOrderName = (string) content.GetValueForProperty("ProductOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ProductOrderName, global::System.Convert.ToString); + } + if (content.Contains("IsAzureCreditEligible")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).IsAzureCreditEligible = (bool?) content.GetValueForProperty("IsAzureCreditEligible",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).IsAzureCreditEligible, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("PublisherName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PublisherName = (string) content.GetValueForProperty("PublisherName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PublisherName, global::System.Convert.ToString); + } + if (content.Contains("PublisherType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PublisherType = (string) content.GetValueForProperty("PublisherType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PublisherType, global::System.Convert.ToString); + } + if (content.Contains("ChargeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ChargeType = (string) content.GetValueForProperty("ChargeType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ChargeType, global::System.Convert.ToString); + } + if (content.Contains("Frequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Frequency = (string) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Frequency, global::System.Convert.ToString); + } + if (content.Contains("CostInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostInBillingCurrency = (decimal?) content.GetValueForProperty("CostInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostInBillingCurrency, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CostInPricingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostInPricingCurrency = (decimal?) content.GetValueForProperty("CostInPricingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostInPricingCurrency, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ExchangeRate = (string) content.GetValueForProperty("ExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ExchangeRate, global::System.Convert.ToString); + } + if (content.Contains("ExchangeRateDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ExchangeRateDate = (global::System.DateTime?) content.GetValueForProperty("ExchangeRateDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ExchangeRateDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InvoiceId, global::System.Convert.ToString); + } + if (content.Contains("PreviousInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PreviousInvoiceId = (string) content.GetValueForProperty("PreviousInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PreviousInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("PricingCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PricingCurrencyCode = (string) content.GetValueForProperty("PricingCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PricingCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("ProductIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ProductIdentifier = (string) content.GetValueForProperty("ProductIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ProductIdentifier, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocationNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResourceLocationNormalized = (string) content.GetValueForProperty("ResourceLocationNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResourceLocationNormalized, global::System.Convert.ToString); + } + if (content.Contains("ServicePeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServicePeriodStartDate = (global::System.DateTime?) content.GetValueForProperty("ServicePeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServicePeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ServicePeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServicePeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("ServicePeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServicePeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CustomerTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CustomerTenantId = (string) content.GetValueForProperty("CustomerTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CustomerTenantId, global::System.Convert.ToString); + } + if (content.Contains("CustomerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CustomerName = (string) content.GetValueForProperty("CustomerName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CustomerName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerTenantId = (string) content.GetValueForProperty("PartnerTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerTenantId, global::System.Convert.ToString); + } + if (content.Contains("PartnerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerName = (string) content.GetValueForProperty("PartnerName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerName, global::System.Convert.ToString); + } + if (content.Contains("ResellerMpnId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResellerMpnId = (string) content.GetValueForProperty("ResellerMpnId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResellerMpnId, global::System.Convert.ToString); + } + if (content.Contains("ResellerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResellerName = (string) content.GetValueForProperty("ResellerName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResellerName, global::System.Convert.ToString); + } + if (content.Contains("PublisherId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PublisherId = (string) content.GetValueForProperty("PublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PublisherId, global::System.Convert.ToString); + } + if (content.Contains("MarketPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MarketPrice = (decimal?) content.GetValueForProperty("MarketPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MarketPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExchangeRatePricingToBilling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ExchangeRatePricingToBilling = (decimal?) content.GetValueForProperty("ExchangeRatePricingToBilling",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ExchangeRatePricingToBilling, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PaygCostInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PaygCostInBillingCurrency = (decimal?) content.GetValueForProperty("PaygCostInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PaygCostInBillingCurrency, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PaygCostInUsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PaygCostInUsd = (decimal?) content.GetValueForProperty("PaygCostInUsd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PaygCostInUsd, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PartnerEarnedCreditRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerEarnedCreditRate = (decimal?) content.GetValueForProperty("PartnerEarnedCreditRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerEarnedCreditRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PartnerEarnedCreditApplied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerEarnedCreditApplied = (string) content.GetValueForProperty("PartnerEarnedCreditApplied",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerEarnedCreditApplied, global::System.Convert.ToString); + } + if (content.Contains("PayGPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PayGPrice = (decimal?) content.GetValueForProperty("PayGPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PayGPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BenefitId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BenefitId = (string) content.GetValueForProperty("BenefitId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BenefitId, global::System.Convert.ToString); + } + if (content.Contains("BenefitName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BenefitName = (string) content.GetValueForProperty("BenefitName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BenefitName, global::System.Convert.ToString); + } + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("CostAllocationRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostAllocationRuleName = (string) content.GetValueForProperty("CostAllocationRuleName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostAllocationRuleName, 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 ModernUsageDetailProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("EffectivePrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).EffectivePrice = (decimal?) content.GetValueForProperty("EffectivePrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).EffectivePrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PricingModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PricingModel = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType?) content.GetValueForProperty("PricingModel",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PricingModel, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType.CreateFrom); + } + if (content.Contains("BillingAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingAccountName = (string) content.GetValueForProperty("BillingAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingAccountName, global::System.Convert.ToString); + } + if (content.Contains("BillingPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingPeriodStartDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingPeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingPeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingPeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("BillingPeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingPeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingProfileName = (string) content.GetValueForProperty("BillingProfileName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingProfileName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).SubscriptionGuid = (string) content.GetValueForProperty("SubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).SubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).SubscriptionName = (string) content.GetValueForProperty("SubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).SubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("Date")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Date = (global::System.DateTime?) content.GetValueForProperty("Date",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Date, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Product")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Product, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("MeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterName = (string) content.GetValueForProperty("MeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterRegion = (string) content.GetValueForProperty("MeterRegion",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterRegion, global::System.Convert.ToString); + } + if (content.Contains("MeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterCategory = (string) content.GetValueForProperty("MeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterSubCategory = (string) content.GetValueForProperty("MeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("ServiceFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServiceFamily = (string) content.GetValueForProperty("ServiceFamily",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServiceFamily, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).UnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("InstanceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InstanceName = (string) content.GetValueForProperty("InstanceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InstanceName, global::System.Convert.ToString); + } + if (content.Contains("CostInUsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostInUsd = (decimal?) content.GetValueForProperty("CostInUsd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostInUsd, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UnitPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).UnitPrice = (decimal?) content.GetValueForProperty("UnitPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).UnitPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BillingCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingCurrencyCode = (string) content.GetValueForProperty("BillingCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BillingCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("ConsumedService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ConsumedService = (string) content.GetValueForProperty("ConsumedService",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ConsumedService, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServiceInfo1 = (string) content.GetValueForProperty("ServiceInfo1",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServiceInfo1, global::System.Convert.ToString); + } + if (content.Contains("ServiceInfo2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServiceInfo2 = (string) content.GetValueForProperty("ServiceInfo2",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServiceInfo2, global::System.Convert.ToString); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).AdditionalInfo, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InvoiceSectionId = (string) content.GetValueForProperty("InvoiceSectionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InvoiceSectionId, global::System.Convert.ToString); + } + if (content.Contains("InvoiceSectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InvoiceSectionName = (string) content.GetValueForProperty("InvoiceSectionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InvoiceSectionName, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("ReservationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ReservationName = (string) content.GetValueForProperty("ReservationName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ReservationName, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ProductOrderId = (string) content.GetValueForProperty("ProductOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ProductOrderId, global::System.Convert.ToString); + } + if (content.Contains("ProductOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ProductOrderName = (string) content.GetValueForProperty("ProductOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ProductOrderName, global::System.Convert.ToString); + } + if (content.Contains("IsAzureCreditEligible")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).IsAzureCreditEligible = (bool?) content.GetValueForProperty("IsAzureCreditEligible",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).IsAzureCreditEligible, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("PublisherName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PublisherName = (string) content.GetValueForProperty("PublisherName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PublisherName, global::System.Convert.ToString); + } + if (content.Contains("PublisherType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PublisherType = (string) content.GetValueForProperty("PublisherType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PublisherType, global::System.Convert.ToString); + } + if (content.Contains("ChargeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ChargeType = (string) content.GetValueForProperty("ChargeType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ChargeType, global::System.Convert.ToString); + } + if (content.Contains("Frequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Frequency = (string) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Frequency, global::System.Convert.ToString); + } + if (content.Contains("CostInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostInBillingCurrency = (decimal?) content.GetValueForProperty("CostInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostInBillingCurrency, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CostInPricingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostInPricingCurrency = (decimal?) content.GetValueForProperty("CostInPricingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostInPricingCurrency, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExchangeRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ExchangeRate = (string) content.GetValueForProperty("ExchangeRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ExchangeRate, global::System.Convert.ToString); + } + if (content.Contains("ExchangeRateDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ExchangeRateDate = (global::System.DateTime?) content.GetValueForProperty("ExchangeRateDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ExchangeRateDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).InvoiceId, global::System.Convert.ToString); + } + if (content.Contains("PreviousInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PreviousInvoiceId = (string) content.GetValueForProperty("PreviousInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PreviousInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("PricingCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PricingCurrencyCode = (string) content.GetValueForProperty("PricingCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PricingCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("ProductIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ProductIdentifier = (string) content.GetValueForProperty("ProductIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ProductIdentifier, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocationNormalized")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResourceLocationNormalized = (string) content.GetValueForProperty("ResourceLocationNormalized",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResourceLocationNormalized, global::System.Convert.ToString); + } + if (content.Contains("ServicePeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServicePeriodStartDate = (global::System.DateTime?) content.GetValueForProperty("ServicePeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServicePeriodStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ServicePeriodEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServicePeriodEndDate = (global::System.DateTime?) content.GetValueForProperty("ServicePeriodEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ServicePeriodEndDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CustomerTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CustomerTenantId = (string) content.GetValueForProperty("CustomerTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CustomerTenantId, global::System.Convert.ToString); + } + if (content.Contains("CustomerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CustomerName = (string) content.GetValueForProperty("CustomerName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CustomerName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerTenantId = (string) content.GetValueForProperty("PartnerTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerTenantId, global::System.Convert.ToString); + } + if (content.Contains("PartnerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerName = (string) content.GetValueForProperty("PartnerName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerName, global::System.Convert.ToString); + } + if (content.Contains("ResellerMpnId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResellerMpnId = (string) content.GetValueForProperty("ResellerMpnId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResellerMpnId, global::System.Convert.ToString); + } + if (content.Contains("ResellerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResellerName = (string) content.GetValueForProperty("ResellerName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ResellerName, global::System.Convert.ToString); + } + if (content.Contains("PublisherId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PublisherId = (string) content.GetValueForProperty("PublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PublisherId, global::System.Convert.ToString); + } + if (content.Contains("MarketPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MarketPrice = (decimal?) content.GetValueForProperty("MarketPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).MarketPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ExchangeRatePricingToBilling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ExchangeRatePricingToBilling = (decimal?) content.GetValueForProperty("ExchangeRatePricingToBilling",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).ExchangeRatePricingToBilling, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PaygCostInBillingCurrency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PaygCostInBillingCurrency = (decimal?) content.GetValueForProperty("PaygCostInBillingCurrency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PaygCostInBillingCurrency, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PaygCostInUsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PaygCostInUsd = (decimal?) content.GetValueForProperty("PaygCostInUsd",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PaygCostInUsd, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PartnerEarnedCreditRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerEarnedCreditRate = (decimal?) content.GetValueForProperty("PartnerEarnedCreditRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerEarnedCreditRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PartnerEarnedCreditApplied")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerEarnedCreditApplied = (string) content.GetValueForProperty("PartnerEarnedCreditApplied",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PartnerEarnedCreditApplied, global::System.Convert.ToString); + } + if (content.Contains("PayGPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PayGPrice = (decimal?) content.GetValueForProperty("PayGPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).PayGPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("BenefitId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BenefitId = (string) content.GetValueForProperty("BenefitId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BenefitId, global::System.Convert.ToString); + } + if (content.Contains("BenefitName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BenefitName = (string) content.GetValueForProperty("BenefitName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).BenefitName, global::System.Convert.ToString); + } + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("CostAllocationRuleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostAllocationRuleName = (string) content.GetValueForProperty("CostAllocationRuleName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal)this).CostAllocationRuleName, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the usage detail. + [System.ComponentModel.TypeConverter(typeof(ModernUsageDetailPropertiesTypeConverter))] + public partial interface IModernUsageDetailProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetailProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetailProperties.TypeConverter.cs new file mode 100644 index 000000000000..833462ce8b18 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetailProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ModernUsageDetailPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IModernUsageDetailProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ModernUsageDetailProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ModernUsageDetailProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ModernUsageDetailProperties.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/consumption/generated/api/Models/Api20211001/ModernUsageDetailProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetailProperties.cs new file mode 100644 index 000000000000..f4c703154baa --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetailProperties.cs @@ -0,0 +1,1705 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the usage detail. + public partial class ModernUsageDetailProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal + { + + /// Backing field for property. + private string _additionalInfo; + + /// + /// Additional details of this usage item. Use this field to get usage line item specific details such as the actual VM Size + /// (ServiceType) or the ratio in which the reservation discount is applied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string AdditionalInfo { get => this._additionalInfo; } + + /// Backing field for property. + private string _benefitId; + + /// Unique identifier for the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BenefitId { get => this._benefitId; } + + /// Backing field for property. + private string _benefitName; + + /// Name of the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BenefitName { get => this._benefitName; } + + /// Backing field for property. + private string _billingAccountId; + + /// Billing Account identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingAccountId { get => this._billingAccountId; } + + /// Backing field for property. + private string _billingAccountName; + + /// Name of the Billing Account. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingAccountName { get => this._billingAccountName; } + + /// Backing field for property. + private string _billingCurrencyCode; + + /// The currency defining the billed cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingCurrencyCode { get => this._billingCurrencyCode; } + + /// Backing field for property. + private global::System.DateTime? _billingPeriodEndDate; + + /// Billing Period End Date as in the invoice. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? BillingPeriodEndDate { get => this._billingPeriodEndDate; } + + /// Backing field for property. + private global::System.DateTime? _billingPeriodStartDate; + + /// Billing Period Start Date as in the invoice. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? BillingPeriodStartDate { get => this._billingPeriodStartDate; } + + /// Backing field for property. + private string _billingProfileId; + + /// + /// Identifier for the billing profile that groups costs across invoices in the a singular billing currency across across + /// the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases + /// like SaaS, Marketplace, RI, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingProfileId { get => this._billingProfileId; } + + /// Backing field for property. + private string _billingProfileName; + + /// + /// Name of the billing profile that groups costs across invoices in the a singular billing currency across across the customers + /// who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like + /// SaaS, Marketplace, RI, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingProfileName { get => this._billingProfileName; } + + /// Backing field for property. + private string _chargeType; + + /// + /// Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ChargeType { get => this._chargeType; } + + /// Backing field for property. + private string _consumedService; + + /// + /// Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided + /// for marketplace usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ConsumedService { get => this._consumedService; } + + /// Backing field for property. + private string _costAllocationRuleName; + + /// Name for Cost Allocation Rule. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CostAllocationRuleName { get => this._costAllocationRuleName; } + + /// Backing field for property. + private string _costCenter; + + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CostCenter { get => this._costCenter; } + + /// Backing field for property. + private decimal? _costInBillingCurrency; + + /// ExtendedCost or blended cost before tax in billed currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? CostInBillingCurrency { get => this._costInBillingCurrency; } + + /// Backing field for property. + private decimal? _costInPricingCurrency; + + /// + /// ExtendedCost or blended cost before tax in pricing currency to correlate with prices. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? CostInPricingCurrency { get => this._costInPricingCurrency; } + + /// Backing field for property. + private decimal? _costInUsd; + + /// Estimated extendedCost or blended cost before tax in USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? CostInUsd { get => this._costInUsd; } + + /// Backing field for property. + private string _customerName; + + /// Name of the customer's AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CustomerName { get => this._customerName; } + + /// Backing field for property. + private string _customerTenantId; + + /// Identifier of the customer's AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CustomerTenantId { get => this._customerTenantId; } + + /// Backing field for property. + private global::System.DateTime? _date; + + /// Date for the usage record. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? Date { get => this._date; } + + /// Backing field for property. + private decimal? _effectivePrice; + + /// Effective Price that's charged for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? EffectivePrice { get => this._effectivePrice; } + + /// Backing field for property. + private string _exchangeRate; + + /// Exchange rate used in conversion from pricing currency to billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ExchangeRate { get => this._exchangeRate; } + + /// Backing field for property. + private global::System.DateTime? _exchangeRateDate; + + /// + /// Date on which exchange rate used in conversion from pricing currency to billing currency. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? ExchangeRateDate { get => this._exchangeRateDate; } + + /// Backing field for property. + private decimal? _exchangeRatePricingToBilling; + + /// Exchange Rate from pricing currency to billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? ExchangeRatePricingToBilling { get => this._exchangeRatePricingToBilling; } + + /// Backing field for property. + private string _frequency; + + /// + /// Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which + /// recur every month, and UsageBased for charges based on how much a service is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Frequency { get => this._frequency; } + + /// Backing field for property. + private string _instanceName; + + /// Instance Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InstanceName { get => this._instanceName; } + + /// Backing field for property. + private string _invoiceId; + + /// Invoice ID as on the invoice where the specific transaction appears. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InvoiceId { get => this._invoiceId; } + + /// Backing field for property. + private string _invoiceSectionId; + + /// + /// Identifier of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded + /// by partners. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InvoiceSectionId { get => this._invoiceSectionId; } + + /// Backing field for property. + private string _invoiceSectionName; + + /// + /// Name of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by + /// partners. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InvoiceSectionName { get => this._invoiceSectionName; } + + /// Backing field for property. + private bool? _isAzureCreditEligible; + + /// Determines if the cost is eligible to be paid for using Azure credits. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public bool? IsAzureCreditEligible { get => this._isAzureCreditEligible; } + + /// Backing field for property. + private decimal? _marketPrice; + + /// Market Price that's charged for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? MarketPrice { get => this._marketPrice; } + + /// Backing field for property. + private string _meterCategory; + + /// Identifies the top-level service for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterCategory { get => this._meterCategory; } + + /// Backing field for property. + private string _meterId; + + /// + /// The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which + /// the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterId { get => this._meterId; } + + /// Backing field for property. + private string _meterName; + + /// Identifies the name of the meter against which consumption is measured. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterName { get => this._meterName; } + + /// Backing field for property. + private string _meterRegion; + + /// + /// Identifies the location of the datacenter for certain services that are priced based on datacenter location. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterRegion { get => this._meterRegion; } + + /// Backing field for property. + private string _meterSubCategory; + + /// Defines the type or sub-category of Azure service that can affect the rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterSubCategory { get => this._meterSubCategory; } + + /// Internal Acessors for AdditionalInfo + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + + /// Internal Acessors for BenefitId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.BenefitId { get => this._benefitId; set { {_benefitId = value;} } } + + /// Internal Acessors for BenefitName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.BenefitName { get => this._benefitName; set { {_benefitName = value;} } } + + /// Internal Acessors for BillingAccountId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.BillingAccountId { get => this._billingAccountId; set { {_billingAccountId = value;} } } + + /// Internal Acessors for BillingAccountName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.BillingAccountName { get => this._billingAccountName; set { {_billingAccountName = value;} } } + + /// Internal Acessors for BillingCurrencyCode + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.BillingCurrencyCode { get => this._billingCurrencyCode; set { {_billingCurrencyCode = value;} } } + + /// Internal Acessors for BillingPeriodEndDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.BillingPeriodEndDate { get => this._billingPeriodEndDate; set { {_billingPeriodEndDate = value;} } } + + /// Internal Acessors for BillingPeriodStartDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.BillingPeriodStartDate { get => this._billingPeriodStartDate; set { {_billingPeriodStartDate = value;} } } + + /// Internal Acessors for BillingProfileId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.BillingProfileId { get => this._billingProfileId; set { {_billingProfileId = value;} } } + + /// Internal Acessors for BillingProfileName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.BillingProfileName { get => this._billingProfileName; set { {_billingProfileName = value;} } } + + /// Internal Acessors for ChargeType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ChargeType { get => this._chargeType; set { {_chargeType = value;} } } + + /// Internal Acessors for ConsumedService + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ConsumedService { get => this._consumedService; set { {_consumedService = value;} } } + + /// Internal Acessors for CostAllocationRuleName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.CostAllocationRuleName { get => this._costAllocationRuleName; set { {_costAllocationRuleName = value;} } } + + /// Internal Acessors for CostCenter + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.CostCenter { get => this._costCenter; set { {_costCenter = value;} } } + + /// Internal Acessors for CostInBillingCurrency + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.CostInBillingCurrency { get => this._costInBillingCurrency; set { {_costInBillingCurrency = value;} } } + + /// Internal Acessors for CostInPricingCurrency + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.CostInPricingCurrency { get => this._costInPricingCurrency; set { {_costInPricingCurrency = value;} } } + + /// Internal Acessors for CostInUsd + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.CostInUsd { get => this._costInUsd; set { {_costInUsd = value;} } } + + /// Internal Acessors for CustomerName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.CustomerName { get => this._customerName; set { {_customerName = value;} } } + + /// Internal Acessors for CustomerTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.CustomerTenantId { get => this._customerTenantId; set { {_customerTenantId = value;} } } + + /// Internal Acessors for Date + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.Date { get => this._date; set { {_date = value;} } } + + /// Internal Acessors for EffectivePrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.EffectivePrice { get => this._effectivePrice; set { {_effectivePrice = value;} } } + + /// Internal Acessors for ExchangeRate + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ExchangeRate { get => this._exchangeRate; set { {_exchangeRate = value;} } } + + /// Internal Acessors for ExchangeRateDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ExchangeRateDate { get => this._exchangeRateDate; set { {_exchangeRateDate = value;} } } + + /// Internal Acessors for ExchangeRatePricingToBilling + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ExchangeRatePricingToBilling { get => this._exchangeRatePricingToBilling; set { {_exchangeRatePricingToBilling = value;} } } + + /// Internal Acessors for Frequency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.Frequency { get => this._frequency; set { {_frequency = value;} } } + + /// Internal Acessors for InstanceName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.InstanceName { get => this._instanceName; set { {_instanceName = value;} } } + + /// Internal Acessors for InvoiceId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.InvoiceId { get => this._invoiceId; set { {_invoiceId = value;} } } + + /// Internal Acessors for InvoiceSectionId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.InvoiceSectionId { get => this._invoiceSectionId; set { {_invoiceSectionId = value;} } } + + /// Internal Acessors for InvoiceSectionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.InvoiceSectionName { get => this._invoiceSectionName; set { {_invoiceSectionName = value;} } } + + /// Internal Acessors for IsAzureCreditEligible + bool? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.IsAzureCreditEligible { get => this._isAzureCreditEligible; set { {_isAzureCreditEligible = value;} } } + + /// Internal Acessors for MarketPrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.MarketPrice { get => this._marketPrice; set { {_marketPrice = value;} } } + + /// Internal Acessors for MeterCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.MeterCategory { get => this._meterCategory; set { {_meterCategory = value;} } } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.MeterId { get => this._meterId; set { {_meterId = value;} } } + + /// Internal Acessors for MeterName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.MeterName { get => this._meterName; set { {_meterName = value;} } } + + /// Internal Acessors for MeterRegion + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.MeterRegion { get => this._meterRegion; set { {_meterRegion = value;} } } + + /// Internal Acessors for MeterSubCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.MeterSubCategory { get => this._meterSubCategory; set { {_meterSubCategory = value;} } } + + /// Internal Acessors for PartnerEarnedCreditApplied + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PartnerEarnedCreditApplied { get => this._partnerEarnedCreditApplied; set { {_partnerEarnedCreditApplied = value;} } } + + /// Internal Acessors for PartnerEarnedCreditRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PartnerEarnedCreditRate { get => this._partnerEarnedCreditRate; set { {_partnerEarnedCreditRate = value;} } } + + /// Internal Acessors for PartnerName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PartnerName { get => this._partnerName; set { {_partnerName = value;} } } + + /// Internal Acessors for PartnerTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PartnerTenantId { get => this._partnerTenantId; set { {_partnerTenantId = value;} } } + + /// Internal Acessors for PayGPrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PayGPrice { get => this._payGPrice; set { {_payGPrice = value;} } } + + /// Internal Acessors for PaygCostInBillingCurrency + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PaygCostInBillingCurrency { get => this._paygCostInBillingCurrency; set { {_paygCostInBillingCurrency = value;} } } + + /// Internal Acessors for PaygCostInUsd + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PaygCostInUsd { get => this._paygCostInUsd; set { {_paygCostInUsd = value;} } } + + /// Internal Acessors for PreviousInvoiceId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PreviousInvoiceId { get => this._previousInvoiceId; set { {_previousInvoiceId = value;} } } + + /// Internal Acessors for PricingCurrencyCode + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PricingCurrencyCode { get => this._pricingCurrencyCode; set { {_pricingCurrencyCode = value;} } } + + /// Internal Acessors for PricingModel + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PricingModel { get => this._pricingModel; set { {_pricingModel = value;} } } + + /// Internal Acessors for Product + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.Product { get => this._product; set { {_product = value;} } } + + /// Internal Acessors for ProductIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ProductIdentifier { get => this._productIdentifier; set { {_productIdentifier = value;} } } + + /// Internal Acessors for ProductOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ProductOrderId { get => this._productOrderId; set { {_productOrderId = value;} } } + + /// Internal Acessors for ProductOrderName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ProductOrderName { get => this._productOrderName; set { {_productOrderName = value;} } } + + /// Internal Acessors for Provider + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.Provider { get => this._provider; set { {_provider = value;} } } + + /// Internal Acessors for PublisherId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PublisherId { get => this._publisherId; set { {_publisherId = value;} } } + + /// Internal Acessors for PublisherName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PublisherName { get => this._publisherName; set { {_publisherName = value;} } } + + /// Internal Acessors for PublisherType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.PublisherType { get => this._publisherType; set { {_publisherType = value;} } } + + /// Internal Acessors for Quantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.Quantity { get => this._quantity; set { {_quantity = value;} } } + + /// Internal Acessors for ResellerMpnId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ResellerMpnId { get => this._resellerMpnId; set { {_resellerMpnId = value;} } } + + /// Internal Acessors for ResellerName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ResellerName { get => this._resellerName; set { {_resellerName = value;} } } + + /// Internal Acessors for ReservationId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ReservationId { get => this._reservationId; set { {_reservationId = value;} } } + + /// Internal Acessors for ReservationName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ReservationName { get => this._reservationName; set { {_reservationName = value;} } } + + /// Internal Acessors for ResourceGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ResourceGroup { get => this._resourceGroup; set { {_resourceGroup = value;} } } + + /// Internal Acessors for ResourceLocation + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ResourceLocation { get => this._resourceLocation; set { {_resourceLocation = value;} } } + + /// Internal Acessors for ResourceLocationNormalized + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ResourceLocationNormalized { get => this._resourceLocationNormalized; set { {_resourceLocationNormalized = value;} } } + + /// Internal Acessors for ServiceFamily + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ServiceFamily { get => this._serviceFamily; set { {_serviceFamily = value;} } } + + /// Internal Acessors for ServiceInfo1 + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ServiceInfo1 { get => this._serviceInfo1; set { {_serviceInfo1 = value;} } } + + /// Internal Acessors for ServiceInfo2 + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ServiceInfo2 { get => this._serviceInfo2; set { {_serviceInfo2 = value;} } } + + /// Internal Acessors for ServicePeriodEndDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ServicePeriodEndDate { get => this._servicePeriodEndDate; set { {_servicePeriodEndDate = value;} } } + + /// Internal Acessors for ServicePeriodStartDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.ServicePeriodStartDate { get => this._servicePeriodStartDate; set { {_servicePeriodStartDate = value;} } } + + /// Internal Acessors for SubscriptionGuid + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.SubscriptionGuid { get => this._subscriptionGuid; set { {_subscriptionGuid = value;} } } + + /// Internal Acessors for SubscriptionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.SubscriptionName { get => this._subscriptionName; set { {_subscriptionName = value;} } } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.Term { get => this._term; set { {_term = value;} } } + + /// Internal Acessors for UnitOfMeasure + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.UnitOfMeasure { get => this._unitOfMeasure; set { {_unitOfMeasure = value;} } } + + /// Internal Acessors for UnitPrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailPropertiesInternal.UnitPrice { get => this._unitPrice; set { {_unitPrice = value;} } } + + /// Backing field for property. + private string _partnerEarnedCreditApplied; + + /// Flag to indicate if partner earned credit has been applied or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PartnerEarnedCreditApplied { get => this._partnerEarnedCreditApplied; } + + /// Backing field for property. + private decimal? _partnerEarnedCreditRate; + + /// + /// Rate of discount applied if there is a partner earned credit (PEC) based on partner admin link access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? PartnerEarnedCreditRate { get => this._partnerEarnedCreditRate; } + + /// Backing field for property. + private string _partnerName; + + /// Name of the partner' AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PartnerName { get => this._partnerName; } + + /// Backing field for property. + private string _partnerTenantId; + + /// Identifier for the partner's AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PartnerTenantId { get => this._partnerTenantId; } + + /// Backing field for property. + private decimal? _payGPrice; + + /// Retail price for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? PayGPrice { get => this._payGPrice; } + + /// Backing field for property. + private decimal? _paygCostInBillingCurrency; + + /// The amount of PayG cost before tax in billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? PaygCostInBillingCurrency { get => this._paygCostInBillingCurrency; } + + /// Backing field for property. + private decimal? _paygCostInUsd; + + /// The amount of PayG cost before tax in US Dollar currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? PaygCostInUsd { get => this._paygCostInUsd; } + + /// Backing field for property. + private string _previousInvoiceId; + + /// + /// Reference to an original invoice there is a refund (negative cost). This is populated only when there is a refund. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PreviousInvoiceId { get => this._previousInvoiceId; } + + /// Backing field for property. + private string _pricingCurrencyCode; + + /// Pricing Billing Currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PricingCurrencyCode { get => this._pricingCurrencyCode; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? _pricingModel; + + /// Identifier that indicates how the meter is priced + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? PricingModel { get => this._pricingModel; } + + /// Backing field for property. + private string _product; + + /// + /// Name of the product that has accrued charges by consumption or purchase as listed in the invoice. Not available for Marketplace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Product { get => this._product; } + + /// Backing field for property. + private string _productIdentifier; + + /// + /// Identifier for the product that has accrued charges by consumption or purchase . This is the concatenated key of productId + /// and SkuId in partner center. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ProductIdentifier { get => this._productIdentifier; } + + /// Backing field for property. + private string _productOrderId; + + /// + /// The identifier for the asset or Azure plan name that the subscription belongs to. For example: Azure Plan. For reservations + /// this is the Reservation Order ID. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ProductOrderId { get => this._productOrderId; } + + /// Backing field for property. + private string _productOrderName; + + /// Product Order Name. For reservations this is the SKU that was purchased. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ProductOrderName { get => this._productOrderName; } + + /// Backing field for property. + private string _provider; + + /// + /// Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS e.t.c + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Provider { get => this._provider; } + + /// Backing field for property. + private string _publisherId; + + /// Publisher Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PublisherId { get => this._publisherId; } + + /// Backing field for property. + private string _publisherName; + + /// + /// Name of the publisher of the service including Microsoft or Third Party publishers. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PublisherName { get => this._publisherName; } + + /// Backing field for property. + private string _publisherType; + + /// + /// Type of publisher that identifies if the publisher is first party, third party reseller or third party agency. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PublisherType { get => this._publisherType; } + + /// Backing field for property. + private decimal? _quantity; + + /// + /// Measure the quantity purchased or consumed.The amount of the meter used during the billing period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? Quantity { get => this._quantity; } + + /// Backing field for property. + private string _resellerMpnId; + + /// MPNId for the reseller associated with the subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResellerMpnId { get => this._resellerMpnId; } + + /// Backing field for property. + private string _resellerName; + + /// Reseller Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResellerName { get => this._resellerName; } + + /// Backing field for property. + private string _reservationId; + + /// + /// ARM resource id of the reservation. Only applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationId { get => this._reservationId; } + + /// Backing field for property. + private string _reservationName; + + /// + /// User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only + /// applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationName { get => this._reservationName; } + + /// Backing field for property. + private string _resourceGroup; + + /// + /// Name of the Azure resource group used for cohesive lifecycle management of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceGroup { get => this._resourceGroup; } + + /// Backing field for property. + private string _resourceLocation; + + /// Name of the resource location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceLocation { get => this._resourceLocation; } + + /// Backing field for property. + private string _resourceLocationNormalized; + + /// Resource Location Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceLocationNormalized { get => this._resourceLocationNormalized; } + + /// Backing field for property. + private string _serviceFamily; + + /// + /// List the service family for the product purchased or charged (Example: Storage ; Compute). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ServiceFamily { get => this._serviceFamily; } + + /// Backing field for property. + private string _serviceInfo1; + + /// Service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ServiceInfo1 { get => this._serviceInfo1; } + + /// Backing field for property. + private string _serviceInfo2; + + /// Legacy field with optional service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ServiceInfo2 { get => this._serviceInfo2; } + + /// Backing field for property. + private global::System.DateTime? _servicePeriodEndDate; + + /// + /// End date for the period when the service usage was rated for charges. The prices for Azure services are determined based + /// on the rating period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? ServicePeriodEndDate { get => this._servicePeriodEndDate; } + + /// Backing field for property. + private global::System.DateTime? _servicePeriodStartDate; + + /// + /// Start date for the rating period when the service usage was rated for charges. The prices for Azure services are determined + /// for the rating period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? ServicePeriodStartDate { get => this._servicePeriodStartDate; } + + /// Backing field for property. + private string _subscriptionGuid; + + /// Unique Microsoft generated identifier for the Azure Subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SubscriptionGuid { get => this._subscriptionGuid; } + + /// Backing field for property. + private string _subscriptionName; + + /// Name of the Azure Subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SubscriptionName { get => this._subscriptionName; } + + /// Backing field for property. + private string _term; + + /// + /// Term (in months). Displays the term for the validity of the offer. For example. In case of reserved instances it displays + /// 12 months for yearly term of reserved instance. For one time purchases or recurring purchases, the terms displays 1 month; + /// This is not applicable for Azure consumption. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Term { get => this._term; } + + /// Backing field for property. + private string _unitOfMeasure; + + /// + /// Identifies the Unit that the service is charged in. For example, GB, hours, 10,000 s. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string UnitOfMeasure { get => this._unitOfMeasure; } + + /// Backing field for property. + private decimal? _unitPrice; + + /// Unit Price is the price applicable to you. (your EA or other contract price). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? UnitPrice { get => this._unitPrice; } + + /// Creates an new instance. + public ModernUsageDetailProperties() + { + + } + } + /// The properties of the usage detail. + public partial interface IModernUsageDetailProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// + /// Additional details of this usage item. Use this field to get usage line item specific details such as the actual VM Size + /// (ServiceType) or the ratio in which the reservation discount is applied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Additional details of this usage item. Use this field to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation discount is applied.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(string) })] + string AdditionalInfo { get; } + /// Unique identifier for the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unique identifier for the applicable benefit.", + SerializedName = @"benefitId", + PossibleTypes = new [] { typeof(string) })] + string BenefitId { get; } + /// Name of the applicable benefit. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the applicable benefit.", + SerializedName = @"benefitName", + PossibleTypes = new [] { typeof(string) })] + string BenefitName { get; } + /// Billing Account identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Account identifier.", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + string BillingAccountId { get; } + /// Name of the Billing Account. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the Billing Account.", + SerializedName = @"billingAccountName", + PossibleTypes = new [] { typeof(string) })] + string BillingAccountName { get; } + /// The currency defining the billed cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The currency defining the billed cost.", + SerializedName = @"billingCurrencyCode", + PossibleTypes = new [] { typeof(string) })] + string BillingCurrencyCode { get; } + /// Billing Period End Date as in the invoice. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Period End Date as in the invoice.", + SerializedName = @"billingPeriodEndDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BillingPeriodEndDate { get; } + /// Billing Period Start Date as in the invoice. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Billing Period Start Date as in the invoice.", + SerializedName = @"billingPeriodStartDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BillingPeriodStartDate { get; } + /// + /// Identifier for the billing profile that groups costs across invoices in the a singular billing currency across across + /// the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases + /// like SaaS, Marketplace, RI, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier for the billing profile that groups costs across invoices in the a singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc.", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileId { get; } + /// + /// Name of the billing profile that groups costs across invoices in the a singular billing currency across across the customers + /// who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like + /// SaaS, Marketplace, RI, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the billing profile that groups costs across invoices in the a singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc.", + SerializedName = @"billingProfileName", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileName { get; } + /// + /// Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund.", + SerializedName = @"chargeType", + PossibleTypes = new [] { typeof(string) })] + string ChargeType { get; } + /// + /// Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided + /// for marketplace usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided for marketplace usage.", + SerializedName = @"consumedService", + PossibleTypes = new [] { typeof(string) })] + string ConsumedService { get; } + /// Name for Cost Allocation Rule. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name for Cost Allocation Rule.", + SerializedName = @"costAllocationRuleName", + PossibleTypes = new [] { typeof(string) })] + string CostAllocationRuleName { get; } + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The cost center of this department if it is a department and a cost center is provided.", + SerializedName = @"costCenter", + PossibleTypes = new [] { typeof(string) })] + string CostCenter { get; } + /// ExtendedCost or blended cost before tax in billed currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ExtendedCost or blended cost before tax in billed currency.", + SerializedName = @"costInBillingCurrency", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CostInBillingCurrency { get; } + /// + /// ExtendedCost or blended cost before tax in pricing currency to correlate with prices. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ExtendedCost or blended cost before tax in pricing currency to correlate with prices.", + SerializedName = @"costInPricingCurrency", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CostInPricingCurrency { get; } + /// Estimated extendedCost or blended cost before tax in USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Estimated extendedCost or blended cost before tax in USD.", + SerializedName = @"costInUSD", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CostInUsd { get; } + /// Name of the customer's AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the customer's AAD tenant.", + SerializedName = @"customerName", + PossibleTypes = new [] { typeof(string) })] + string CustomerName { get; } + /// Identifier of the customer's AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier of the customer's AAD tenant.", + SerializedName = @"customerTenantId", + PossibleTypes = new [] { typeof(string) })] + string CustomerTenantId { get; } + /// Date for the usage record. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date for the usage record.", + SerializedName = @"date", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Date { get; } + /// Effective Price that's charged for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Effective Price that's charged for the usage.", + SerializedName = @"effectivePrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? EffectivePrice { get; } + /// Exchange rate used in conversion from pricing currency to billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Exchange rate used in conversion from pricing currency to billing currency.", + SerializedName = @"exchangeRate", + PossibleTypes = new [] { typeof(string) })] + string ExchangeRate { get; } + /// + /// Date on which exchange rate used in conversion from pricing currency to billing currency. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date on which exchange rate used in conversion from pricing currency to billing currency.", + SerializedName = @"exchangeRateDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExchangeRateDate { get; } + /// Exchange Rate from pricing currency to billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Exchange Rate from pricing currency to billing currency.", + SerializedName = @"exchangeRatePricingToBilling", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ExchangeRatePricingToBilling { get; } + /// + /// Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which + /// recur every month, and UsageBased for charges based on how much a service is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is used.", + SerializedName = @"frequency", + PossibleTypes = new [] { typeof(string) })] + string Frequency { get; } + /// Instance Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Instance Name.", + SerializedName = @"instanceName", + PossibleTypes = new [] { typeof(string) })] + string InstanceName { get; } + /// Invoice ID as on the invoice where the specific transaction appears. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Invoice ID as on the invoice where the specific transaction appears.", + SerializedName = @"invoiceId", + PossibleTypes = new [] { typeof(string) })] + string InvoiceId { get; } + /// + /// Identifier of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded + /// by partners. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by partners.", + SerializedName = @"invoiceSectionId", + PossibleTypes = new [] { typeof(string) })] + string InvoiceSectionId { get; } + /// + /// Name of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by + /// partners. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by partners.", + SerializedName = @"invoiceSectionName", + PossibleTypes = new [] { typeof(string) })] + string InvoiceSectionName { get; } + /// Determines if the cost is eligible to be paid for using Azure credits. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Determines if the cost is eligible to be paid for using Azure credits.", + SerializedName = @"isAzureCreditEligible", + PossibleTypes = new [] { typeof(bool) })] + bool? IsAzureCreditEligible { get; } + /// Market Price that's charged for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Market Price that's charged for the usage.", + SerializedName = @"marketPrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MarketPrice { get; } + /// Identifies the top-level service for the usage. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifies the top-level service for the usage.", + SerializedName = @"meterCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterCategory { get; } + /// + /// The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which + /// the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName.", + SerializedName = @"meterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// Identifies the name of the meter against which consumption is measured. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifies the name of the meter against which consumption is measured.", + SerializedName = @"meterName", + PossibleTypes = new [] { typeof(string) })] + string MeterName { get; } + /// + /// Identifies the location of the datacenter for certain services that are priced based on datacenter location. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifies the location of the datacenter for certain services that are priced based on datacenter location.", + SerializedName = @"meterRegion", + PossibleTypes = new [] { typeof(string) })] + string MeterRegion { get; } + /// Defines the type or sub-category of Azure service that can affect the rate. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Defines the type or sub-category of Azure service that can affect the rate.", + SerializedName = @"meterSubCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterSubCategory { get; } + /// Flag to indicate if partner earned credit has been applied or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Flag to indicate if partner earned credit has been applied or not.", + SerializedName = @"partnerEarnedCreditApplied", + PossibleTypes = new [] { typeof(string) })] + string PartnerEarnedCreditApplied { get; } + /// + /// Rate of discount applied if there is a partner earned credit (PEC) based on partner admin link access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Rate of discount applied if there is a partner earned credit (PEC) based on partner admin link access.", + SerializedName = @"partnerEarnedCreditRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PartnerEarnedCreditRate { get; } + /// Name of the partner' AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the partner' AAD tenant.", + SerializedName = @"partnerName", + PossibleTypes = new [] { typeof(string) })] + string PartnerName { get; } + /// Identifier for the partner's AAD tenant. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier for the partner's AAD tenant.", + SerializedName = @"partnerTenantId", + PossibleTypes = new [] { typeof(string) })] + string PartnerTenantId { get; } + /// Retail price for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Retail price for the resource.", + SerializedName = @"payGPrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PayGPrice { get; } + /// The amount of PayG cost before tax in billing currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The amount of PayG cost before tax in billing currency.", + SerializedName = @"paygCostInBillingCurrency", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PaygCostInBillingCurrency { get; } + /// The amount of PayG cost before tax in US Dollar currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The amount of PayG cost before tax in US Dollar currency.", + SerializedName = @"paygCostInUSD", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PaygCostInUsd { get; } + /// + /// Reference to an original invoice there is a refund (negative cost). This is populated only when there is a refund. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reference to an original invoice there is a refund (negative cost). This is populated only when there is a refund.", + SerializedName = @"previousInvoiceId", + PossibleTypes = new [] { typeof(string) })] + string PreviousInvoiceId { get; } + /// Pricing Billing Currency. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Pricing Billing Currency.", + SerializedName = @"pricingCurrencyCode", + PossibleTypes = new [] { typeof(string) })] + string PricingCurrencyCode { get; } + /// Identifier that indicates how the meter is priced + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier that indicates how the meter is priced", + SerializedName = @"pricingModel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? PricingModel { get; } + /// + /// Name of the product that has accrued charges by consumption or purchase as listed in the invoice. Not available for Marketplace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the product that has accrued charges by consumption or purchase as listed in the invoice. Not available for Marketplace.", + SerializedName = @"product", + PossibleTypes = new [] { typeof(string) })] + string Product { get; } + /// + /// Identifier for the product that has accrued charges by consumption or purchase . This is the concatenated key of productId + /// and SkuId in partner center. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier for the product that has accrued charges by consumption or purchase . This is the concatenated key of productId and SkuId in partner center.", + SerializedName = @"productIdentifier", + PossibleTypes = new [] { typeof(string) })] + string ProductIdentifier { get; } + /// + /// The identifier for the asset or Azure plan name that the subscription belongs to. For example: Azure Plan. For reservations + /// this is the Reservation Order ID. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The identifier for the asset or Azure plan name that the subscription belongs to. For example: Azure Plan. For reservations this is the Reservation Order ID.", + SerializedName = @"productOrderId", + PossibleTypes = new [] { typeof(string) })] + string ProductOrderId { get; } + /// Product Order Name. For reservations this is the SKU that was purchased. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Product Order Name. For reservations this is the SKU that was purchased.", + SerializedName = @"productOrderName", + PossibleTypes = new [] { typeof(string) })] + string ProductOrderName { get; } + /// + /// Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS e.t.c + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS e.t.c", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; } + /// Publisher Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Publisher Id.", + SerializedName = @"publisherId", + PossibleTypes = new [] { typeof(string) })] + string PublisherId { get; } + /// + /// Name of the publisher of the service including Microsoft or Third Party publishers. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the publisher of the service including Microsoft or Third Party publishers.", + SerializedName = @"publisherName", + PossibleTypes = new [] { typeof(string) })] + string PublisherName { get; } + /// + /// Type of publisher that identifies if the publisher is first party, third party reseller or third party agency. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of publisher that identifies if the publisher is first party, third party reseller or third party agency.", + SerializedName = @"publisherType", + PossibleTypes = new [] { typeof(string) })] + string PublisherType { get; } + /// + /// Measure the quantity purchased or consumed.The amount of the meter used during the billing period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Measure the quantity purchased or consumed.The amount of the meter used during the billing period.", + SerializedName = @"quantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Quantity { get; } + /// MPNId for the reseller associated with the subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"MPNId for the reseller associated with the subscription.", + SerializedName = @"resellerMpnId", + PossibleTypes = new [] { typeof(string) })] + string ResellerMpnId { get; } + /// Reseller Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reseller Name.", + SerializedName = @"resellerName", + PossibleTypes = new [] { typeof(string) })] + string ResellerName { get; } + /// + /// ARM resource id of the reservation. Only applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ARM resource id of the reservation. Only applies to records relevant to reservations.", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + string ReservationId { get; } + /// + /// User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only + /// applies to records relevant to reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only applies to records relevant to reservations.", + SerializedName = @"reservationName", + PossibleTypes = new [] { typeof(string) })] + string ReservationName { get; } + /// + /// Name of the Azure resource group used for cohesive lifecycle management of resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the Azure resource group used for cohesive lifecycle management of resources.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; } + /// Name of the resource location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the resource location.", + SerializedName = @"resourceLocation", + PossibleTypes = new [] { typeof(string) })] + string ResourceLocation { get; } + /// Resource Location Normalized. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Location Normalized.", + SerializedName = @"resourceLocationNormalized", + PossibleTypes = new [] { typeof(string) })] + string ResourceLocationNormalized { get; } + /// + /// List the service family for the product purchased or charged (Example: Storage ; Compute). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List the service family for the product purchased or charged (Example: Storage ; Compute).", + SerializedName = @"serviceFamily", + PossibleTypes = new [] { typeof(string) })] + string ServiceFamily { get; } + /// Service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service-specific metadata.", + SerializedName = @"serviceInfo1", + PossibleTypes = new [] { typeof(string) })] + string ServiceInfo1 { get; } + /// Legacy field with optional service-specific metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Legacy field with optional service-specific metadata.", + SerializedName = @"serviceInfo2", + PossibleTypes = new [] { typeof(string) })] + string ServiceInfo2 { get; } + /// + /// End date for the period when the service usage was rated for charges. The prices for Azure services are determined based + /// on the rating period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"End date for the period when the service usage was rated for charges. The prices for Azure services are determined based on the rating period.", + SerializedName = @"servicePeriodEndDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ServicePeriodEndDate { get; } + /// + /// Start date for the rating period when the service usage was rated for charges. The prices for Azure services are determined + /// for the rating period. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Start date for the rating period when the service usage was rated for charges. The prices for Azure services are determined for the rating period.", + SerializedName = @"servicePeriodStartDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ServicePeriodStartDate { get; } + /// Unique Microsoft generated identifier for the Azure Subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unique Microsoft generated identifier for the Azure Subscription.", + SerializedName = @"subscriptionGuid", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionGuid { get; } + /// Name of the Azure Subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the Azure Subscription.", + SerializedName = @"subscriptionName", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionName { get; } + /// + /// Term (in months). Displays the term for the validity of the offer. For example. In case of reserved instances it displays + /// 12 months for yearly term of reserved instance. For one time purchases or recurring purchases, the terms displays 1 month; + /// This is not applicable for Azure consumption. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Term (in months). Displays the term for the validity of the offer. For example. In case of reserved instances it displays 12 months for yearly term of reserved instance. For one time purchases or recurring purchases, the terms displays 1 month; This is not applicable for Azure consumption.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(string) })] + string Term { get; } + /// + /// Identifies the Unit that the service is charged in. For example, GB, hours, 10,000 s. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifies the Unit that the service is charged in. For example, GB, hours, 10,000 s.", + SerializedName = @"unitOfMeasure", + PossibleTypes = new [] { typeof(string) })] + string UnitOfMeasure { get; } + /// Unit Price is the price applicable to you. (your EA or other contract price). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unit Price is the price applicable to you. (your EA or other contract price).", + SerializedName = @"unitPrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UnitPrice { get; } + + } + /// The properties of the usage detail. + internal partial interface IModernUsageDetailPropertiesInternal + + { + /// + /// Additional details of this usage item. Use this field to get usage line item specific details such as the actual VM Size + /// (ServiceType) or the ratio in which the reservation discount is applied. + /// + string AdditionalInfo { get; set; } + /// Unique identifier for the applicable benefit. + string BenefitId { get; set; } + /// Name of the applicable benefit. + string BenefitName { get; set; } + /// Billing Account identifier. + string BillingAccountId { get; set; } + /// Name of the Billing Account. + string BillingAccountName { get; set; } + /// The currency defining the billed cost. + string BillingCurrencyCode { get; set; } + /// Billing Period End Date as in the invoice. + global::System.DateTime? BillingPeriodEndDate { get; set; } + /// Billing Period Start Date as in the invoice. + global::System.DateTime? BillingPeriodStartDate { get; set; } + /// + /// Identifier for the billing profile that groups costs across invoices in the a singular billing currency across across + /// the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases + /// like SaaS, Marketplace, RI, etc. + /// + string BillingProfileId { get; set; } + /// + /// Name of the billing profile that groups costs across invoices in the a singular billing currency across across the customers + /// who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like + /// SaaS, Marketplace, RI, etc. + /// + string BillingProfileName { get; set; } + /// + /// Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. + /// + string ChargeType { get; set; } + /// + /// Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided + /// for marketplace usage. + /// + string ConsumedService { get; set; } + /// Name for Cost Allocation Rule. + string CostAllocationRuleName { get; set; } + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + string CostCenter { get; set; } + /// ExtendedCost or blended cost before tax in billed currency. + decimal? CostInBillingCurrency { get; set; } + /// + /// ExtendedCost or blended cost before tax in pricing currency to correlate with prices. + /// + decimal? CostInPricingCurrency { get; set; } + /// Estimated extendedCost or blended cost before tax in USD. + decimal? CostInUsd { get; set; } + /// Name of the customer's AAD tenant. + string CustomerName { get; set; } + /// Identifier of the customer's AAD tenant. + string CustomerTenantId { get; set; } + /// Date for the usage record. + global::System.DateTime? Date { get; set; } + /// Effective Price that's charged for the usage. + decimal? EffectivePrice { get; set; } + /// Exchange rate used in conversion from pricing currency to billing currency. + string ExchangeRate { get; set; } + /// + /// Date on which exchange rate used in conversion from pricing currency to billing currency. + /// + global::System.DateTime? ExchangeRateDate { get; set; } + /// Exchange Rate from pricing currency to billing currency. + decimal? ExchangeRatePricingToBilling { get; set; } + /// + /// Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees which + /// recur every month, and UsageBased for charges based on how much a service is used. + /// + string Frequency { get; set; } + /// Instance Name. + string InstanceName { get; set; } + /// Invoice ID as on the invoice where the specific transaction appears. + string InvoiceId { get; set; } + /// + /// Identifier of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded + /// by partners. + /// + string InvoiceSectionId { get; set; } + /// + /// Name of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded by + /// partners. + /// + string InvoiceSectionName { get; set; } + /// Determines if the cost is eligible to be paid for using Azure credits. + bool? IsAzureCreditEligible { get; set; } + /// Market Price that's charged for the usage. + decimal? MarketPrice { get; set; } + /// Identifies the top-level service for the usage. + string MeterCategory { get; set; } + /// + /// The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for which + /// the reservation was purchased. For the actual VM Size for which the reservation is purchased see productOrderName. + /// + string MeterId { get; set; } + /// Identifies the name of the meter against which consumption is measured. + string MeterName { get; set; } + /// + /// Identifies the location of the datacenter for certain services that are priced based on datacenter location. + /// + string MeterRegion { get; set; } + /// Defines the type or sub-category of Azure service that can affect the rate. + string MeterSubCategory { get; set; } + /// Flag to indicate if partner earned credit has been applied or not. + string PartnerEarnedCreditApplied { get; set; } + /// + /// Rate of discount applied if there is a partner earned credit (PEC) based on partner admin link access. + /// + decimal? PartnerEarnedCreditRate { get; set; } + /// Name of the partner' AAD tenant. + string PartnerName { get; set; } + /// Identifier for the partner's AAD tenant. + string PartnerTenantId { get; set; } + /// Retail price for the resource. + decimal? PayGPrice { get; set; } + /// The amount of PayG cost before tax in billing currency. + decimal? PaygCostInBillingCurrency { get; set; } + /// The amount of PayG cost before tax in US Dollar currency. + decimal? PaygCostInUsd { get; set; } + /// + /// Reference to an original invoice there is a refund (negative cost). This is populated only when there is a refund. + /// + string PreviousInvoiceId { get; set; } + /// Pricing Billing Currency. + string PricingCurrencyCode { get; set; } + /// Identifier that indicates how the meter is priced + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType? PricingModel { get; set; } + /// + /// Name of the product that has accrued charges by consumption or purchase as listed in the invoice. Not available for Marketplace. + /// + string Product { get; set; } + /// + /// Identifier for the product that has accrued charges by consumption or purchase . This is the concatenated key of productId + /// and SkuId in partner center. + /// + string ProductIdentifier { get; set; } + /// + /// The identifier for the asset or Azure plan name that the subscription belongs to. For example: Azure Plan. For reservations + /// this is the Reservation Order ID. + /// + string ProductOrderId { get; set; } + /// Product Order Name. For reservations this is the SKU that was purchased. + string ProductOrderName { get; set; } + /// + /// Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS e.t.c + /// + string Provider { get; set; } + /// Publisher Id. + string PublisherId { get; set; } + /// + /// Name of the publisher of the service including Microsoft or Third Party publishers. + /// + string PublisherName { get; set; } + /// + /// Type of publisher that identifies if the publisher is first party, third party reseller or third party agency. + /// + string PublisherType { get; set; } + /// + /// Measure the quantity purchased or consumed.The amount of the meter used during the billing period. + /// + decimal? Quantity { get; set; } + /// MPNId for the reseller associated with the subscription. + string ResellerMpnId { get; set; } + /// Reseller Name. + string ResellerName { get; set; } + /// + /// ARM resource id of the reservation. Only applies to records relevant to reservations. + /// + string ReservationId { get; set; } + /// + /// User provided display name of the reservation. Last known name for a particular day is populated in the daily data. Only + /// applies to records relevant to reservations. + /// + string ReservationName { get; set; } + /// + /// Name of the Azure resource group used for cohesive lifecycle management of resources. + /// + string ResourceGroup { get; set; } + /// Name of the resource location. + string ResourceLocation { get; set; } + /// Resource Location Normalized. + string ResourceLocationNormalized { get; set; } + /// + /// List the service family for the product purchased or charged (Example: Storage ; Compute). + /// + string ServiceFamily { get; set; } + /// Service-specific metadata. + string ServiceInfo1 { get; set; } + /// Legacy field with optional service-specific metadata. + string ServiceInfo2 { get; set; } + /// + /// End date for the period when the service usage was rated for charges. The prices for Azure services are determined based + /// on the rating period. + /// + global::System.DateTime? ServicePeriodEndDate { get; set; } + /// + /// Start date for the rating period when the service usage was rated for charges. The prices for Azure services are determined + /// for the rating period. + /// + global::System.DateTime? ServicePeriodStartDate { get; set; } + /// Unique Microsoft generated identifier for the Azure Subscription. + string SubscriptionGuid { get; set; } + /// Name of the Azure Subscription. + string SubscriptionName { get; set; } + /// + /// Term (in months). Displays the term for the validity of the offer. For example. In case of reserved instances it displays + /// 12 months for yearly term of reserved instance. For one time purchases or recurring purchases, the terms displays 1 month; + /// This is not applicable for Azure consumption. + /// + string Term { get; set; } + /// + /// Identifies the Unit that the service is charged in. For example, GB, hours, 10,000 s. + /// + string UnitOfMeasure { get; set; } + /// Unit Price is the price applicable to you. (your EA or other contract price). + decimal? UnitPrice { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetailProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetailProperties.json.cs new file mode 100644 index 000000000000..7bda1328dd2f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ModernUsageDetailProperties.json.cs @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the usage detail. + public partial class ModernUsageDetailProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernUsageDetailProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ModernUsageDetailProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ModernUsageDetailProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_billingAccountId = If( json?.PropertyT("billingAccountId"), out var __jsonBillingAccountId) ? (string)__jsonBillingAccountId : (string)BillingAccountId;} + {_effectivePrice = If( json?.PropertyT("effectivePrice"), out var __jsonEffectivePrice) ? (decimal?)__jsonEffectivePrice : EffectivePrice;} + {_pricingModel = If( json?.PropertyT("pricingModel"), out var __jsonPricingModel) ? (string)__jsonPricingModel : (string)PricingModel;} + {_billingAccountName = If( json?.PropertyT("billingAccountName"), out var __jsonBillingAccountName) ? (string)__jsonBillingAccountName : (string)BillingAccountName;} + {_billingPeriodStartDate = If( json?.PropertyT("billingPeriodStartDate"), out var __jsonBillingPeriodStartDate) ? global::System.DateTime.TryParse((string)__jsonBillingPeriodStartDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBillingPeriodStartDateValue) ? __jsonBillingPeriodStartDateValue : BillingPeriodStartDate : BillingPeriodStartDate;} + {_billingPeriodEndDate = If( json?.PropertyT("billingPeriodEndDate"), out var __jsonBillingPeriodEndDate) ? global::System.DateTime.TryParse((string)__jsonBillingPeriodEndDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBillingPeriodEndDateValue) ? __jsonBillingPeriodEndDateValue : BillingPeriodEndDate : BillingPeriodEndDate;} + {_billingProfileId = If( json?.PropertyT("billingProfileId"), out var __jsonBillingProfileId) ? (string)__jsonBillingProfileId : (string)BillingProfileId;} + {_billingProfileName = If( json?.PropertyT("billingProfileName"), out var __jsonBillingProfileName) ? (string)__jsonBillingProfileName : (string)BillingProfileName;} + {_subscriptionGuid = If( json?.PropertyT("subscriptionGuid"), out var __jsonSubscriptionGuid) ? (string)__jsonSubscriptionGuid : (string)SubscriptionGuid;} + {_subscriptionName = If( json?.PropertyT("subscriptionName"), out var __jsonSubscriptionName) ? (string)__jsonSubscriptionName : (string)SubscriptionName;} + {_date = If( json?.PropertyT("date"), out var __jsonDate) ? global::System.DateTime.TryParse((string)__jsonDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDateValue) ? __jsonDateValue : Date : Date;} + {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? (string)__jsonProduct : (string)Product;} + {_meterId = If( json?.PropertyT("meterId"), out var __jsonMeterId) ? (string)__jsonMeterId : (string)MeterId;} + {_meterName = If( json?.PropertyT("meterName"), out var __jsonMeterName) ? (string)__jsonMeterName : (string)MeterName;} + {_meterRegion = If( json?.PropertyT("meterRegion"), out var __jsonMeterRegion) ? (string)__jsonMeterRegion : (string)MeterRegion;} + {_meterCategory = If( json?.PropertyT("meterCategory"), out var __jsonMeterCategory) ? (string)__jsonMeterCategory : (string)MeterCategory;} + {_meterSubCategory = If( json?.PropertyT("meterSubCategory"), out var __jsonMeterSubCategory) ? (string)__jsonMeterSubCategory : (string)MeterSubCategory;} + {_serviceFamily = If( json?.PropertyT("serviceFamily"), out var __jsonServiceFamily) ? (string)__jsonServiceFamily : (string)ServiceFamily;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (decimal?)__jsonQuantity : Quantity;} + {_unitOfMeasure = If( json?.PropertyT("unitOfMeasure"), out var __jsonUnitOfMeasure) ? (string)__jsonUnitOfMeasure : (string)UnitOfMeasure;} + {_instanceName = If( json?.PropertyT("instanceName"), out var __jsonInstanceName) ? (string)__jsonInstanceName : (string)InstanceName;} + {_costInUsd = If( json?.PropertyT("costInUSD"), out var __jsonCostInUsd) ? (decimal?)__jsonCostInUsd : CostInUsd;} + {_unitPrice = If( json?.PropertyT("unitPrice"), out var __jsonUnitPrice) ? (decimal?)__jsonUnitPrice : UnitPrice;} + {_billingCurrencyCode = If( json?.PropertyT("billingCurrencyCode"), out var __jsonBillingCurrencyCode) ? (string)__jsonBillingCurrencyCode : (string)BillingCurrencyCode;} + {_resourceLocation = If( json?.PropertyT("resourceLocation"), out var __jsonResourceLocation) ? (string)__jsonResourceLocation : (string)ResourceLocation;} + {_consumedService = If( json?.PropertyT("consumedService"), out var __jsonConsumedService) ? (string)__jsonConsumedService : (string)ConsumedService;} + {_serviceInfo1 = If( json?.PropertyT("serviceInfo1"), out var __jsonServiceInfo1) ? (string)__jsonServiceInfo1 : (string)ServiceInfo1;} + {_serviceInfo2 = If( json?.PropertyT("serviceInfo2"), out var __jsonServiceInfo2) ? (string)__jsonServiceInfo2 : (string)ServiceInfo2;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? (string)__jsonAdditionalInfo : (string)AdditionalInfo;} + {_invoiceSectionId = If( json?.PropertyT("invoiceSectionId"), out var __jsonInvoiceSectionId) ? (string)__jsonInvoiceSectionId : (string)InvoiceSectionId;} + {_invoiceSectionName = If( json?.PropertyT("invoiceSectionName"), out var __jsonInvoiceSectionName) ? (string)__jsonInvoiceSectionName : (string)InvoiceSectionName;} + {_costCenter = If( json?.PropertyT("costCenter"), out var __jsonCostCenter) ? (string)__jsonCostCenter : (string)CostCenter;} + {_resourceGroup = If( json?.PropertyT("resourceGroup"), out var __jsonResourceGroup) ? (string)__jsonResourceGroup : (string)ResourceGroup;} + {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)ReservationId;} + {_reservationName = If( json?.PropertyT("reservationName"), out var __jsonReservationName) ? (string)__jsonReservationName : (string)ReservationName;} + {_productOrderId = If( json?.PropertyT("productOrderId"), out var __jsonProductOrderId) ? (string)__jsonProductOrderId : (string)ProductOrderId;} + {_productOrderName = If( json?.PropertyT("productOrderName"), out var __jsonProductOrderName) ? (string)__jsonProductOrderName : (string)ProductOrderName;} + {_isAzureCreditEligible = If( json?.PropertyT("isAzureCreditEligible"), out var __jsonIsAzureCreditEligible) ? (bool?)__jsonIsAzureCreditEligible : IsAzureCreditEligible;} + {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)Term;} + {_publisherName = If( json?.PropertyT("publisherName"), out var __jsonPublisherName) ? (string)__jsonPublisherName : (string)PublisherName;} + {_publisherType = If( json?.PropertyT("publisherType"), out var __jsonPublisherType) ? (string)__jsonPublisherType : (string)PublisherType;} + {_chargeType = If( json?.PropertyT("chargeType"), out var __jsonChargeType) ? (string)__jsonChargeType : (string)ChargeType;} + {_frequency = If( json?.PropertyT("frequency"), out var __jsonFrequency) ? (string)__jsonFrequency : (string)Frequency;} + {_costInBillingCurrency = If( json?.PropertyT("costInBillingCurrency"), out var __jsonCostInBillingCurrency) ? (decimal?)__jsonCostInBillingCurrency : CostInBillingCurrency;} + {_costInPricingCurrency = If( json?.PropertyT("costInPricingCurrency"), out var __jsonCostInPricingCurrency) ? (decimal?)__jsonCostInPricingCurrency : CostInPricingCurrency;} + {_exchangeRate = If( json?.PropertyT("exchangeRate"), out var __jsonExchangeRate) ? (string)__jsonExchangeRate : (string)ExchangeRate;} + {_exchangeRateDate = If( json?.PropertyT("exchangeRateDate"), out var __jsonExchangeRateDate) ? global::System.DateTime.TryParse((string)__jsonExchangeRateDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExchangeRateDateValue) ? __jsonExchangeRateDateValue : ExchangeRateDate : ExchangeRateDate;} + {_invoiceId = If( json?.PropertyT("invoiceId"), out var __jsonInvoiceId) ? (string)__jsonInvoiceId : (string)InvoiceId;} + {_previousInvoiceId = If( json?.PropertyT("previousInvoiceId"), out var __jsonPreviousInvoiceId) ? (string)__jsonPreviousInvoiceId : (string)PreviousInvoiceId;} + {_pricingCurrencyCode = If( json?.PropertyT("pricingCurrencyCode"), out var __jsonPricingCurrencyCode) ? (string)__jsonPricingCurrencyCode : (string)PricingCurrencyCode;} + {_productIdentifier = If( json?.PropertyT("productIdentifier"), out var __jsonProductIdentifier) ? (string)__jsonProductIdentifier : (string)ProductIdentifier;} + {_resourceLocationNormalized = If( json?.PropertyT("resourceLocationNormalized"), out var __jsonResourceLocationNormalized) ? (string)__jsonResourceLocationNormalized : (string)ResourceLocationNormalized;} + {_servicePeriodStartDate = If( json?.PropertyT("servicePeriodStartDate"), out var __jsonServicePeriodStartDate) ? global::System.DateTime.TryParse((string)__jsonServicePeriodStartDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonServicePeriodStartDateValue) ? __jsonServicePeriodStartDateValue : ServicePeriodStartDate : ServicePeriodStartDate;} + {_servicePeriodEndDate = If( json?.PropertyT("servicePeriodEndDate"), out var __jsonServicePeriodEndDate) ? global::System.DateTime.TryParse((string)__jsonServicePeriodEndDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonServicePeriodEndDateValue) ? __jsonServicePeriodEndDateValue : ServicePeriodEndDate : ServicePeriodEndDate;} + {_customerTenantId = If( json?.PropertyT("customerTenantId"), out var __jsonCustomerTenantId) ? (string)__jsonCustomerTenantId : (string)CustomerTenantId;} + {_customerName = If( json?.PropertyT("customerName"), out var __jsonCustomerName) ? (string)__jsonCustomerName : (string)CustomerName;} + {_partnerTenantId = If( json?.PropertyT("partnerTenantId"), out var __jsonPartnerTenantId) ? (string)__jsonPartnerTenantId : (string)PartnerTenantId;} + {_partnerName = If( json?.PropertyT("partnerName"), out var __jsonPartnerName) ? (string)__jsonPartnerName : (string)PartnerName;} + {_resellerMpnId = If( json?.PropertyT("resellerMpnId"), out var __jsonResellerMpnId) ? (string)__jsonResellerMpnId : (string)ResellerMpnId;} + {_resellerName = If( json?.PropertyT("resellerName"), out var __jsonResellerName) ? (string)__jsonResellerName : (string)ResellerName;} + {_publisherId = If( json?.PropertyT("publisherId"), out var __jsonPublisherId) ? (string)__jsonPublisherId : (string)PublisherId;} + {_marketPrice = If( json?.PropertyT("marketPrice"), out var __jsonMarketPrice) ? (decimal?)__jsonMarketPrice : MarketPrice;} + {_exchangeRatePricingToBilling = If( json?.PropertyT("exchangeRatePricingToBilling"), out var __jsonExchangeRatePricingToBilling) ? (decimal?)__jsonExchangeRatePricingToBilling : ExchangeRatePricingToBilling;} + {_paygCostInBillingCurrency = If( json?.PropertyT("paygCostInBillingCurrency"), out var __jsonPaygCostInBillingCurrency) ? (decimal?)__jsonPaygCostInBillingCurrency : PaygCostInBillingCurrency;} + {_paygCostInUsd = If( json?.PropertyT("paygCostInUSD"), out var __jsonPaygCostInUsd) ? (decimal?)__jsonPaygCostInUsd : PaygCostInUsd;} + {_partnerEarnedCreditRate = If( json?.PropertyT("partnerEarnedCreditRate"), out var __jsonPartnerEarnedCreditRate) ? (decimal?)__jsonPartnerEarnedCreditRate : PartnerEarnedCreditRate;} + {_partnerEarnedCreditApplied = If( json?.PropertyT("partnerEarnedCreditApplied"), out var __jsonPartnerEarnedCreditApplied) ? (string)__jsonPartnerEarnedCreditApplied : (string)PartnerEarnedCreditApplied;} + {_payGPrice = If( json?.PropertyT("payGPrice"), out var __jsonPayGPrice) ? (decimal?)__jsonPayGPrice : PayGPrice;} + {_benefitId = If( json?.PropertyT("benefitId"), out var __jsonBenefitId) ? (string)__jsonBenefitId : (string)BenefitId;} + {_benefitName = If( json?.PropertyT("benefitName"), out var __jsonBenefitName) ? (string)__jsonBenefitName : (string)BenefitName;} + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} + {_costAllocationRuleName = If( json?.PropertyT("costAllocationRuleName"), out var __jsonCostAllocationRuleName) ? (string)__jsonCostAllocationRuleName : (string)CostAllocationRuleName;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingAccountId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingAccountId.ToString()) : null, "billingAccountId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._effectivePrice ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._effectivePrice) : null, "effectivePrice" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._pricingModel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._pricingModel.ToString()) : null, "pricingModel" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingAccountName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingAccountName.ToString()) : null, "billingAccountName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._billingPeriodStartDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingPeriodStartDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "billingPeriodStartDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._billingPeriodEndDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingPeriodEndDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "billingPeriodEndDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingProfileId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingProfileId.ToString()) : null, "billingProfileId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingProfileName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingProfileName.ToString()) : null, "billingProfileName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._subscriptionGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._subscriptionGuid.ToString()) : null, "subscriptionGuid" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._subscriptionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._subscriptionName.ToString()) : null, "subscriptionName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._date ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._date?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "date" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._product)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._product.ToString()) : null, "product" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterId.ToString()) : null, "meterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterName.ToString()) : null, "meterName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterRegion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterRegion.ToString()) : null, "meterRegion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterCategory)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterCategory.ToString()) : null, "meterCategory" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterSubCategory)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterSubCategory.ToString()) : null, "meterSubCategory" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serviceFamily)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._serviceFamily.ToString()) : null, "serviceFamily" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._quantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._quantity) : null, "quantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._unitOfMeasure)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._unitOfMeasure.ToString()) : null, "unitOfMeasure" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._instanceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._instanceName.ToString()) : null, "instanceName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._costInUsd ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._costInUsd) : null, "costInUSD" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._unitPrice ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._unitPrice) : null, "unitPrice" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingCurrencyCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingCurrencyCode.ToString()) : null, "billingCurrencyCode" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceLocation.ToString()) : null, "resourceLocation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._consumedService)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._consumedService.ToString()) : null, "consumedService" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serviceInfo1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._serviceInfo1.ToString()) : null, "serviceInfo1" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serviceInfo2)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._serviceInfo2.ToString()) : null, "serviceInfo2" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._additionalInfo)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._additionalInfo.ToString()) : null, "additionalInfo" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._invoiceSectionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._invoiceSectionId.ToString()) : null, "invoiceSectionId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._invoiceSectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._invoiceSectionName.ToString()) : null, "invoiceSectionName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._costCenter)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._costCenter.ToString()) : null, "costCenter" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceGroup.ToString()) : null, "resourceGroup" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationId.ToString()) : null, "reservationId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationName.ToString()) : null, "reservationName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._productOrderId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._productOrderId.ToString()) : null, "productOrderId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._productOrderName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._productOrderName.ToString()) : null, "productOrderName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isAzureCreditEligible ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonBoolean((bool)this._isAzureCreditEligible) : null, "isAzureCreditEligible" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._term)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._term.ToString()) : null, "term" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._publisherName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._publisherName.ToString()) : null, "publisherName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._publisherType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._publisherType.ToString()) : null, "publisherType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._chargeType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._chargeType.ToString()) : null, "chargeType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._frequency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._frequency.ToString()) : null, "frequency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._costInBillingCurrency ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._costInBillingCurrency) : null, "costInBillingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._costInPricingCurrency ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._costInPricingCurrency) : null, "costInPricingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._exchangeRate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._exchangeRate.ToString()) : null, "exchangeRate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._exchangeRateDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._exchangeRateDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "exchangeRateDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._invoiceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._invoiceId.ToString()) : null, "invoiceId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._previousInvoiceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._previousInvoiceId.ToString()) : null, "previousInvoiceId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._pricingCurrencyCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._pricingCurrencyCode.ToString()) : null, "pricingCurrencyCode" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._productIdentifier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._productIdentifier.ToString()) : null, "productIdentifier" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceLocationNormalized)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceLocationNormalized.ToString()) : null, "resourceLocationNormalized" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._servicePeriodStartDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._servicePeriodStartDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "servicePeriodStartDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._servicePeriodEndDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._servicePeriodEndDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "servicePeriodEndDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._customerTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._customerTenantId.ToString()) : null, "customerTenantId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._customerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._customerName.ToString()) : null, "customerName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._partnerTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._partnerTenantId.ToString()) : null, "partnerTenantId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._partnerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._partnerName.ToString()) : null, "partnerName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resellerMpnId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resellerMpnId.ToString()) : null, "resellerMpnId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resellerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resellerName.ToString()) : null, "resellerName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._publisherId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._publisherId.ToString()) : null, "publisherId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._marketPrice ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._marketPrice) : null, "marketPrice" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._exchangeRatePricingToBilling ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._exchangeRatePricingToBilling) : null, "exchangeRatePricingToBilling" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._paygCostInBillingCurrency ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._paygCostInBillingCurrency) : null, "paygCostInBillingCurrency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._paygCostInUsd ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._paygCostInUsd) : null, "paygCostInUSD" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._partnerEarnedCreditRate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._partnerEarnedCreditRate) : null, "partnerEarnedCreditRate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._partnerEarnedCreditApplied)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._partnerEarnedCreditApplied.ToString()) : null, "partnerEarnedCreditApplied" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._payGPrice ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._payGPrice) : null, "payGPrice" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._benefitId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._benefitId.ToString()) : null, "benefitId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._benefitName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._benefitName.ToString()) : null, "benefitName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._costAllocationRuleName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._costAllocationRuleName.ToString()) : null, "costAllocationRuleName" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Notification.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Notification.PowerShell.cs new file mode 100644 index 000000000000..1a0c19fc2788 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Notification.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The notification associated with a budget. + [System.ComponentModel.TypeConverter(typeof(NotificationTypeConverter))] + public partial class Notification + { + + /// + /// 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.Consumption.Models.Api20211001.INotification DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Notification(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.Consumption.Models.Api20211001.INotification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Notification(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.Consumption.Models.Api20211001.INotification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Notification(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType.CreateFrom); + } + if (content.Contains("Threshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Threshold = (decimal) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Threshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ContactEmail = (string[]) content.GetValueForProperty("ContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ContactRole = (string[]) content.GetValueForProperty("ContactRole",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ContactGroup = (string[]) content.GetValueForProperty("ContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType?) content.GetValueForProperty("ThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ThresholdType, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType.CreateFrom); + } + if (content.Contains("Locale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Locale = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode?) content.GetValueForProperty("Locale",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Locale, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Notification(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType.CreateFrom); + } + if (content.Contains("Threshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Threshold = (decimal) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Threshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ContactEmail = (string[]) content.GetValueForProperty("ContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ContactRole = (string[]) content.GetValueForProperty("ContactRole",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ContactGroup = (string[]) content.GetValueForProperty("ContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType?) content.GetValueForProperty("ThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).ThresholdType, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType.CreateFrom); + } + if (content.Contains("Locale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Locale = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode?) content.GetValueForProperty("Locale",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal)this).Locale, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The notification associated with a budget. + [System.ComponentModel.TypeConverter(typeof(NotificationTypeConverter))] + public partial interface INotification + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Notification.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Notification.TypeConverter.cs new file mode 100644 index 000000000000..7fe241973556 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Notification.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NotificationTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.INotification ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotification).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Notification.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Notification.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Notification.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/consumption/generated/api/Models/Api20211001/Notification.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Notification.cs new file mode 100644 index 000000000000..9e5dd565638e --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Notification.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The notification associated with a budget. + public partial class Notification : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotification, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotificationInternal + { + + /// Backing field for property. + private string[] _contactEmail; + + /// + /// Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email + /// or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact + /// email specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string[] ContactEmail { get => this._contactEmail; set => this._contactEmail = value; } + + /// Backing field for property. + private string[] _contactGroup; + + /// + /// Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified + /// Azure resource id. Only supported at Subscription or Resource Group scopes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string[] ContactGroup { get => this._contactGroup; set => this._contactGroup = value; } + + /// Backing field for property. + private string[] _contactRole; + + /// + /// Contact roles to send the budget notification to when the threshold is exceeded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string[] ContactRole { get => this._contactRole; set => this._contactRole = value; } + + /// Backing field for property. + private bool _enabled; + + /// The notification is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public bool Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode? _locale; + + /// Language in which the recipient will receive the notification + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode? Locale { get => this._locale; set => this._locale = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType _operator; + + /// The comparison operator. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType Operator { get => this._operator; set => this._operator = value; } + + /// Backing field for property. + private decimal _threshold; + + /// + /// Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always + /// percent and has to be between 0 and 1000. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal Threshold { get => this._threshold; set => this._threshold = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType? _thresholdType; + + /// The type of threshold + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType? ThresholdType { get => this._thresholdType; set => this._thresholdType = value; } + + /// Creates an new instance. + public Notification() + { + + } + } + /// The notification associated with a budget. + public partial interface INotification : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// + /// Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email + /// or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact + /// email specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.", + SerializedName = @"contactEmails", + PossibleTypes = new [] { typeof(string) })] + string[] ContactEmail { get; set; } + /// + /// Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified + /// Azure resource id. Only supported at Subscription or Resource Group scopes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. Only supported at Subscription or Resource Group scopes.", + SerializedName = @"contactGroups", + PossibleTypes = new [] { typeof(string) })] + string[] ContactGroup { get; set; } + /// + /// Contact roles to send the budget notification to when the threshold is exceeded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Contact roles to send the budget notification to when the threshold is exceeded.", + SerializedName = @"contactRoles", + PossibleTypes = new [] { typeof(string) })] + string[] ContactRole { get; set; } + /// The notification is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The notification is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool Enabled { get; set; } + /// Language in which the recipient will receive the notification + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Language in which the recipient will receive the notification", + SerializedName = @"locale", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode? Locale { get; set; } + /// The comparison operator. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The comparison operator.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType Operator { get; set; } + /// + /// Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always + /// percent and has to be between 0 and 1000. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0 and 1000.", + SerializedName = @"threshold", + PossibleTypes = new [] { typeof(decimal) })] + decimal Threshold { get; set; } + /// The type of threshold + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of threshold", + SerializedName = @"thresholdType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType? ThresholdType { get; set; } + + } + /// The notification associated with a budget. + internal partial interface INotificationInternal + + { + /// + /// Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email + /// or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact + /// email specified. + /// + string[] ContactEmail { get; set; } + /// + /// Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified + /// Azure resource id. Only supported at Subscription or Resource Group scopes. + /// + string[] ContactGroup { get; set; } + /// + /// Contact roles to send the budget notification to when the threshold is exceeded. + /// + string[] ContactRole { get; set; } + /// The notification is enabled or not. + bool Enabled { get; set; } + /// Language in which the recipient will receive the notification + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode? Locale { get; set; } + /// The comparison operator. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType Operator { get; set; } + /// + /// Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always + /// percent and has to be between 0 and 1000. + /// + decimal Threshold { get; set; } + /// The type of threshold + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType? ThresholdType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Notification.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Notification.json.cs new file mode 100644 index 000000000000..e95b9aeeff07 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Notification.json.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The notification associated with a budget. + public partial class Notification + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotification. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotification. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.INotification FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new Notification(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal Notification(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)Operator;} + {_threshold = If( json?.PropertyT("threshold"), out var __jsonThreshold) ? (decimal)__jsonThreshold : Threshold;} + {_contactEmail = If( json?.PropertyT("contactEmails"), out var __jsonContactEmails) ? If( __jsonContactEmails as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ContactEmail;} + {_contactRole = If( json?.PropertyT("contactRoles"), out var __jsonContactRoles) ? If( __jsonContactRoles as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ContactRole;} + {_contactGroup = If( json?.PropertyT("contactGroups"), out var __jsonContactGroups) ? If( __jsonContactGroups as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : ContactGroup;} + {_thresholdType = If( json?.PropertyT("thresholdType"), out var __jsonThresholdType) ? (string)__jsonThresholdType : (string)ThresholdType;} + {_locale = If( json?.PropertyT("locale"), out var __jsonLocale) ? (string)__jsonLocale : (string)Locale;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonBoolean(this._enabled), "enabled" ,container.Add ); + AddIf( null != (((object)this._operator)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._operator.ToString()) : null, "operator" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber(this._threshold), "threshold" ,container.Add ); + if (null != this._contactEmail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._contactEmail ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("contactEmails",__w); + } + if (null != this._contactRole) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __s in this._contactRole ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("contactRoles",__r); + } + if (null != this._contactGroup) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __n in this._contactGroup ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("contactGroups",__m); + } + AddIf( null != (((object)this._thresholdType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._thresholdType.ToString()) : null, "thresholdType" ,container.Add ); + AddIf( null != (((object)this._locale)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._locale.ToString()) : null, "locale" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Operation.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Operation.PowerShell.cs new file mode 100644 index 000000000000..e83bf4a031a8 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// A Consumption 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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A Consumption REST API operation. + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial interface IOperation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Operation.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Operation.TypeConverter.cs new file mode 100644 index 000000000000..3246d899e1e7 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IOperation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/Operation.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Operation.cs new file mode 100644 index 000000000000..09fe0a21f4a4 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A Consumption REST API operation. + public partial class Operation : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplay _display; + + /// The object that represents the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.OperationDisplay()); set => this._display = value; } + + /// Description of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)Display).Description; } + + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)Display).Operation; } + + /// Service provider: Microsoft.Consumption. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)Display).Provider; } + + /// Resource on which the operation is performed: UsageDetail, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)Display).Resource; } + + /// Backing field for property. + private string _id; + + /// Operation Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.OperationDisplay()); set { {_display = value;} } } + + /// Internal Acessors for DisplayDescription + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)Display).Description = value; } + + /// Internal Acessors for DisplayOperation + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)Display).Operation = value; } + + /// Internal Acessors for DisplayProvider + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)Display).Provider = value; } + + /// Internal Acessors for DisplayResource + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)Display).Resource = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Creates an new instance. + public Operation() + { + + } + } + /// A Consumption REST API operation. + public partial interface IOperation : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Description of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Description of the operation.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; } + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service provider: Microsoft.Consumption.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; } + /// Resource on which the operation is performed: UsageDetail, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource on which the operation is performed: UsageDetail, etc.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; } + /// Operation Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Operation Id.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Operation name: {provider}/{resource}/{operation}. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Operation name: {provider}/{resource}/{operation}.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + + } + /// A Consumption REST API operation. + internal partial interface IOperationInternal + + { + /// The object that represents the operation. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplay Display { get; set; } + /// Description of the operation. + string DisplayDescription { get; set; } + /// Operation type: Read, write, delete, etc. + string DisplayOperation { get; set; } + /// Service provider: Microsoft.Consumption. + string DisplayProvider { get; set; } + /// Resource on which the operation is performed: UsageDetail, etc. + string DisplayResource { get; set; } + /// Operation Id. + string Id { get; set; } + /// Operation name: {provider}/{resource}/{operation}. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Operation.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Operation.json.cs new file mode 100644 index 000000000000..1bf92384a4b2 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A Consumption 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new Operation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal Operation(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/OperationDisplay.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/OperationDisplay.PowerShell.cs new file mode 100644 index 000000000000..996a7320414b --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/OperationDisplay.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/OperationDisplay.TypeConverter.cs new file mode 100644 index 000000000000..152180f8ac44 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IOperationDisplay ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/OperationDisplay.cs b/swaggerci/consumption/generated/api/Models/Api20211001/OperationDisplay.cs new file mode 100644 index 000000000000..d2bb8591f2f5 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The object that represents the operation. + public partial class OperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for Operation + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } + + /// Internal Acessors for Provider + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } + + /// Internal Acessors for Resource + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Operation { get => this._operation; } + + /// Backing field for property. + private string _provider; + + /// Service provider: Microsoft.Consumption. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Provider { get => this._provider; } + + /// Backing field for property. + private string _resource; + + /// Resource on which the operation is performed: UsageDetail, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IJsonSerializable + { + /// Description of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Description of the operation.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service provider: Microsoft.Consumption.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; } + /// Resource on which the operation is performed: UsageDetail, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource on which the operation is performed: UsageDetail, etc.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; } + + } + /// The object that represents the operation. + internal partial interface IOperationDisplayInternal + + { + /// Description of the operation. + string Description { get; set; } + /// Operation type: Read, write, delete, etc. + string Operation { get; set; } + /// Service provider: Microsoft.Consumption. + string Provider { get; set; } + /// Resource on which the operation is performed: UsageDetail, etc. + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/OperationDisplay.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/OperationDisplay.json.cs new file mode 100644 index 000000000000..310a60db9045 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/OperationListResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/OperationListResult.PowerShell.cs new file mode 100644 index 000000000000..973251e27ef5 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// Result of listing consumption 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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.OperationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.OperationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing consumption 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/consumption/generated/api/Models/Api20211001/OperationListResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/OperationListResult.TypeConverter.cs new file mode 100644 index 000000000000..a23608c7ae3a --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IOperationListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/OperationListResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/OperationListResult.cs new file mode 100644 index 000000000000..824d9b6e15e4 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Result of listing consumption 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.Consumption.Models.Api20211001.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation[] _value; + + /// + /// List of consumption operations supported by the Microsoft.Consumption resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation[] Value { get => this._value; } + + /// Creates an new instance. + public OperationListResult() + { + + } + } + /// Result of listing consumption 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.Consumption.Runtime.IJsonSerializable + { + /// URL to get the next set of operation list results if there are any. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 consumption operations supported by the Microsoft.Consumption resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of consumption operations supported by the Microsoft.Consumption resource provider.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation[] Value { get; } + + } + /// Result of listing consumption 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 consumption operations supported by the Microsoft.Consumption resource provider. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/OperationListResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/OperationListResult.json.cs new file mode 100644 index 000000000000..d1dec3f432f9 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Result of listing consumption 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/PriceSheetModel.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetModel.PowerShell.cs new file mode 100644 index 000000000000..0f7b1cd617e9 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetModel.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// price sheet result. It contains the pricesheet associated with billing period + [System.ComponentModel.TypeConverter(typeof(PriceSheetModelTypeConverter))] + public partial class PriceSheetModel + { + + /// + /// 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.Consumption.Models.Api20211001.IPriceSheetModel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PriceSheetModel(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.Consumption.Models.Api20211001.IPriceSheetModel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PriceSheetModel(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.Consumption.Models.Api20211001.IPriceSheetModel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PriceSheetModel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Download")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).Download = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails) content.GetValueForProperty("Download",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).Download, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Pricesheet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).Pricesheet = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[]) content.GetValueForProperty("Pricesheet",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).Pricesheet, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterName = (string) content.GetValueForProperty("DownloadMeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterName, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterCategory = (string) content.GetValueForProperty("DownloadMeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterCategory, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterSubCategory = (string) content.GetValueForProperty("DownloadMeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("DownloadUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadUnit = (string) content.GetValueForProperty("DownloadUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadUnit, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterLocation = (string) content.GetValueForProperty("DownloadMeterLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterLocation, global::System.Convert.ToString); + } + if (content.Contains("DownloadTotalIncludedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadTotalIncludedQuantity = (decimal?) content.GetValueForProperty("DownloadTotalIncludedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadTotalIncludedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DownloadPretaxStandardRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadPretaxStandardRate = (decimal?) content.GetValueForProperty("DownloadPretaxStandardRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadPretaxStandardRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DownloadServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadServiceName = (string) content.GetValueForProperty("DownloadServiceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadServiceName, global::System.Convert.ToString); + } + if (content.Contains("DownloadServiceTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadServiceTier = (string) content.GetValueForProperty("DownloadServiceTier",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadServiceTier, 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 PriceSheetModel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Download")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).Download = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails) content.GetValueForProperty("Download",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).Download, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Pricesheet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).Pricesheet = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[]) content.GetValueForProperty("Pricesheet",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).Pricesheet, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterName = (string) content.GetValueForProperty("DownloadMeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterName, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterCategory = (string) content.GetValueForProperty("DownloadMeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterCategory, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterSubCategory = (string) content.GetValueForProperty("DownloadMeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("DownloadUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadUnit = (string) content.GetValueForProperty("DownloadUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadUnit, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterLocation = (string) content.GetValueForProperty("DownloadMeterLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadMeterLocation, global::System.Convert.ToString); + } + if (content.Contains("DownloadTotalIncludedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadTotalIncludedQuantity = (decimal?) content.GetValueForProperty("DownloadTotalIncludedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadTotalIncludedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DownloadPretaxStandardRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadPretaxStandardRate = (decimal?) content.GetValueForProperty("DownloadPretaxStandardRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadPretaxStandardRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DownloadServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadServiceName = (string) content.GetValueForProperty("DownloadServiceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadServiceName, global::System.Convert.ToString); + } + if (content.Contains("DownloadServiceTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadServiceTier = (string) content.GetValueForProperty("DownloadServiceTier",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)this).DownloadServiceTier, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// price sheet result. It contains the pricesheet associated with billing period + [System.ComponentModel.TypeConverter(typeof(PriceSheetModelTypeConverter))] + public partial interface IPriceSheetModel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetModel.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetModel.TypeConverter.cs new file mode 100644 index 000000000000..ec90c47d86e6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetModel.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PriceSheetModelTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IPriceSheetModel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PriceSheetModel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PriceSheetModel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PriceSheetModel.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/consumption/generated/api/Models/Api20211001/PriceSheetModel.cs b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetModel.cs new file mode 100644 index 000000000000..bef9ab30f5c9 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetModel.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// price sheet result. It contains the pricesheet associated with billing period + public partial class PriceSheetModel : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModel, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails _download; + + /// Pricesheet download details. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails Download { get => (this._download = this._download ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetails()); } + + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadMeterCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).MeterCategory; } + + /// The location in which the Azure service is available. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadMeterLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).MeterLocation; } + + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadMeterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).MeterName; } + + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadMeterSubCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).MeterSubCategory; } + + /// The pretax listing price. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? DownloadPretaxStandardRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).PretaxStandardRate; } + + /// The name of the service. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadServiceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).ServiceName; } + + /// The service tier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadServiceTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).ServiceTier; } + + /// The total included quantity associated with the offer. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? DownloadTotalIncludedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).TotalIncludedQuantity; } + + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).Unit; } + + /// Internal Acessors for Download + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal.Download { get => (this._download = this._download ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetails()); set { {_download = value;} } } + + /// Internal Acessors for DownloadMeterCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal.DownloadMeterCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).MeterCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).MeterCategory = value; } + + /// Internal Acessors for DownloadMeterLocation + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal.DownloadMeterLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).MeterLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).MeterLocation = value; } + + /// Internal Acessors for DownloadMeterName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal.DownloadMeterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).MeterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).MeterName = value; } + + /// Internal Acessors for DownloadMeterSubCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal.DownloadMeterSubCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).MeterSubCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).MeterSubCategory = value; } + + /// Internal Acessors for DownloadPretaxStandardRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal.DownloadPretaxStandardRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).PretaxStandardRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).PretaxStandardRate = value; } + + /// Internal Acessors for DownloadServiceName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal.DownloadServiceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).ServiceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).ServiceName = value; } + + /// Internal Acessors for DownloadServiceTier + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal.DownloadServiceTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).ServiceTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).ServiceTier = value; } + + /// Internal Acessors for DownloadTotalIncludedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal.DownloadTotalIncludedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).TotalIncludedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).TotalIncludedQuantity = value; } + + /// Internal Acessors for DownloadUnit + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal.DownloadUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).Unit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)Download).Unit = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Pricesheet + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal.Pricesheet { get => this._pricesheet; set { {_pricesheet = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[] _pricesheet; + + /// Price sheet + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[] Pricesheet { get => this._pricesheet; } + + /// Creates an new instance. + public PriceSheetModel() + { + + } + } + /// price sheet result. It contains the pricesheet associated with billing period + public partial interface IPriceSheetModel : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The category of the meter, for example, 'Cloud services', 'Networking', etc..", + SerializedName = @"meterCategory", + PossibleTypes = new [] { typeof(string) })] + string DownloadMeterCategory { get; } + /// The location in which the Azure service is available. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The location in which the Azure service is available.", + SerializedName = @"meterLocation", + PossibleTypes = new [] { typeof(string) })] + string DownloadMeterLocation { get; } + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the meter, within the given meter category", + SerializedName = @"meterName", + PossibleTypes = new [] { typeof(string) })] + string DownloadMeterName { get; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc..", + SerializedName = @"meterSubCategory", + PossibleTypes = new [] { typeof(string) })] + string DownloadMeterSubCategory { get; } + /// The pretax listing price. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The pretax listing price.", + SerializedName = @"pretaxStandardRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DownloadPretaxStandardRate { get; } + /// The name of the service. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the service.", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + string DownloadServiceName { get; } + /// The service tier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The service tier.", + SerializedName = @"serviceTier", + PossibleTypes = new [] { typeof(string) })] + string DownloadServiceTier { get; } + /// The total included quantity associated with the offer. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total included quantity associated with the offer.", + SerializedName = @"totalIncludedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DownloadTotalIncludedQuantity { get; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string DownloadUnit { get; } + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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; } + /// Price sheet + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Price sheet", + SerializedName = @"pricesheets", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[] Pricesheet { get; } + + } + /// price sheet result. It contains the pricesheet associated with billing period + internal partial interface IPriceSheetModelInternal + + { + /// Pricesheet download details. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails Download { get; set; } + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + string DownloadMeterCategory { get; set; } + /// The location in which the Azure service is available. + string DownloadMeterLocation { get; set; } + /// The name of the meter, within the given meter category + string DownloadMeterName { get; set; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + string DownloadMeterSubCategory { get; set; } + /// The pretax listing price. + decimal? DownloadPretaxStandardRate { get; set; } + /// The name of the service. + string DownloadServiceName { get; set; } + /// The service tier. + string DownloadServiceTier { get; set; } + /// The total included quantity associated with the offer. + decimal? DownloadTotalIncludedQuantity { get; set; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + string DownloadUnit { get; set; } + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// Price sheet + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[] Pricesheet { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetModel.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetModel.json.cs new file mode 100644 index 000000000000..4262ee094bdc --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetModel.json.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// price sheet result. It contains the pricesheet associated with billing period + public partial class PriceSheetModel + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModel FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new PriceSheetModel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal PriceSheetModel(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_download = If( json?.PropertyT("download"), out var __jsonDownload) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetails.FromJson(__jsonDownload) : Download;} + {_pricesheet = If( json?.PropertyT("pricesheets"), out var __jsonPricesheets) ? If( __jsonPricesheets as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IPriceSheetProperties) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetProperties.FromJson(__u) )) ))() : null : Pricesheet;} + {_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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._download ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._download.ToJson(null,serializationMode) : null, "download" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._pricesheet) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._pricesheet ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("pricesheets",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/PriceSheetProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetProperties.PowerShell.cs new file mode 100644 index 000000000000..6d85e9fa6c32 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetProperties.PowerShell.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the price sheet. + [System.ComponentModel.TypeConverter(typeof(PriceSheetPropertiesTypeConverter))] + public partial class PriceSheetProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IPriceSheetProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PriceSheetProperties(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.Consumption.Models.Api20211001.IPriceSheetProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PriceSheetProperties(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.Consumption.Models.Api20211001.IPriceSheetProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PriceSheetProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeterDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails) content.GetValueForProperty("MeterDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetail, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).UnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("IncludedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).IncludedQuantity = (decimal?) content.GetValueForProperty("IncludedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).IncludedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PartNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).PartNumber = (string) content.GetValueForProperty("PartNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).PartNumber, global::System.Convert.ToString); + } + if (content.Contains("UnitPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).UnitPrice = (decimal?) content.GetValueForProperty("UnitPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).UnitPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).CurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("OfferId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).OfferId = (string) content.GetValueForProperty("OfferId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).OfferId, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterName = (string) content.GetValueForProperty("MeterDetailMeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterCategory = (string) content.GetValueForProperty("MeterDetailMeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailUnit = (string) content.GetValueForProperty("MeterDetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailUnit, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterLocation = (string) content.GetValueForProperty("MeterDetailMeterLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterLocation, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailServiceName = (string) content.GetValueForProperty("MeterDetailServiceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailServiceName, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailServiceTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailServiceTier = (string) content.GetValueForProperty("MeterDetailServiceTier",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailServiceTier, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterSubCategory = (string) content.GetValueForProperty("MeterDetailMeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailTotalIncludedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailTotalIncludedQuantity = (decimal?) content.GetValueForProperty("MeterDetailTotalIncludedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailTotalIncludedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MeterDetailPretaxStandardRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailPretaxStandardRate = (decimal?) content.GetValueForProperty("MeterDetailPretaxStandardRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailPretaxStandardRate, (__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 PriceSheetProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeterDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetail = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails) content.GetValueForProperty("MeterDetail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetail, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPeriodId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).BillingPeriodId = (string) content.GetValueForProperty("BillingPeriodId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).BillingPeriodId, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).UnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("IncludedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).IncludedQuantity = (decimal?) content.GetValueForProperty("IncludedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).IncludedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("PartNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).PartNumber = (string) content.GetValueForProperty("PartNumber",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).PartNumber, global::System.Convert.ToString); + } + if (content.Contains("UnitPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).UnitPrice = (decimal?) content.GetValueForProperty("UnitPrice",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).UnitPrice, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("CurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).CurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("OfferId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).OfferId = (string) content.GetValueForProperty("OfferId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).OfferId, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterName = (string) content.GetValueForProperty("MeterDetailMeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterName, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterCategory = (string) content.GetValueForProperty("MeterDetailMeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailUnit = (string) content.GetValueForProperty("MeterDetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailUnit, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterLocation = (string) content.GetValueForProperty("MeterDetailMeterLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterLocation, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailServiceName = (string) content.GetValueForProperty("MeterDetailServiceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailServiceName, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailServiceTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailServiceTier = (string) content.GetValueForProperty("MeterDetailServiceTier",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailServiceTier, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailMeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterSubCategory = (string) content.GetValueForProperty("MeterDetailMeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailMeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("MeterDetailTotalIncludedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailTotalIncludedQuantity = (decimal?) content.GetValueForProperty("MeterDetailTotalIncludedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailTotalIncludedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MeterDetailPretaxStandardRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailPretaxStandardRate = (decimal?) content.GetValueForProperty("MeterDetailPretaxStandardRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal)this).MeterDetailPretaxStandardRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the price sheet. + [System.ComponentModel.TypeConverter(typeof(PriceSheetPropertiesTypeConverter))] + public partial interface IPriceSheetProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetProperties.TypeConverter.cs new file mode 100644 index 000000000000..97b4dc35eb8e --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PriceSheetPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IPriceSheetProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PriceSheetProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PriceSheetProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PriceSheetProperties.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/consumption/generated/api/Models/Api20211001/PriceSheetProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetProperties.cs new file mode 100644 index 000000000000..8d5817848e47 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetProperties.cs @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the price sheet. + public partial class PriceSheetProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal + { + + /// Backing field for property. + private string _billingPeriodId; + + /// The id of the billing period resource that the usage belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingPeriodId { get => this._billingPeriodId; } + + /// Backing field for property. + private string _currencyCode; + + /// Currency Code + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CurrencyCode { get => this._currencyCode; } + + /// Backing field for property. + private decimal? _includedQuantity; + + /// Included quality for an offer + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? IncludedQuantity { get => this._includedQuantity; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails _meterDetail; + + /// + /// The details about the meter. By default this is not populated, unless it's specified in $expand. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails MeterDetail { get => (this._meterDetail = this._meterDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetails()); } + + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailMeterCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).MeterCategory; } + + /// The location in which the Azure service is available. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailMeterLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).MeterLocation; } + + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailMeterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).MeterName; } + + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailMeterSubCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).MeterSubCategory; } + + /// The pretax listing price. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? MeterDetailPretaxStandardRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).PretaxStandardRate; } + + /// The name of the service. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailServiceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).ServiceName; } + + /// The service tier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailServiceTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).ServiceTier; } + + /// The total included quantity associated with the offer. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? MeterDetailTotalIncludedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).TotalIncludedQuantity; } + + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string MeterDetailUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).Unit; } + + /// Backing field for property. + private string _meterId; + + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string MeterId { get => this._meterId; } + + /// Internal Acessors for BillingPeriodId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.BillingPeriodId { get => this._billingPeriodId; set { {_billingPeriodId = value;} } } + + /// Internal Acessors for CurrencyCode + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.CurrencyCode { get => this._currencyCode; set { {_currencyCode = value;} } } + + /// Internal Acessors for IncludedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.IncludedQuantity { get => this._includedQuantity; set { {_includedQuantity = value;} } } + + /// Internal Acessors for MeterDetail + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.MeterDetail { get => (this._meterDetail = this._meterDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetails()); set { {_meterDetail = value;} } } + + /// Internal Acessors for MeterDetailMeterCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.MeterDetailMeterCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).MeterCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).MeterCategory = value; } + + /// Internal Acessors for MeterDetailMeterLocation + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.MeterDetailMeterLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).MeterLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).MeterLocation = value; } + + /// Internal Acessors for MeterDetailMeterName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.MeterDetailMeterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).MeterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).MeterName = value; } + + /// Internal Acessors for MeterDetailMeterSubCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.MeterDetailMeterSubCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).MeterSubCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).MeterSubCategory = value; } + + /// Internal Acessors for MeterDetailPretaxStandardRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.MeterDetailPretaxStandardRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).PretaxStandardRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).PretaxStandardRate = value; } + + /// Internal Acessors for MeterDetailServiceName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.MeterDetailServiceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).ServiceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).ServiceName = value; } + + /// Internal Acessors for MeterDetailServiceTier + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.MeterDetailServiceTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).ServiceTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).ServiceTier = value; } + + /// Internal Acessors for MeterDetailTotalIncludedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.MeterDetailTotalIncludedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).TotalIncludedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).TotalIncludedQuantity = value; } + + /// Internal Acessors for MeterDetailUnit + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.MeterDetailUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).Unit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetailsInternal)MeterDetail).Unit = value; } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.MeterId { get => this._meterId; set { {_meterId = value;} } } + + /// Internal Acessors for OfferId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.OfferId { get => this._offerId; set { {_offerId = value;} } } + + /// Internal Acessors for PartNumber + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.PartNumber { get => this._partNumber; set { {_partNumber = value;} } } + + /// Internal Acessors for UnitOfMeasure + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.UnitOfMeasure { get => this._unitOfMeasure; set { {_unitOfMeasure = value;} } } + + /// Internal Acessors for UnitPrice + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetPropertiesInternal.UnitPrice { get => this._unitPrice; set { {_unitPrice = value;} } } + + /// Backing field for property. + private string _offerId; + + /// Offer Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string OfferId { get => this._offerId; } + + /// Backing field for property. + private string _partNumber; + + /// Part Number + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PartNumber { get => this._partNumber; } + + /// Backing field for property. + private string _unitOfMeasure; + + /// Unit of measure + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string UnitOfMeasure { get => this._unitOfMeasure; } + + /// Backing field for property. + private decimal? _unitPrice; + + /// Unit Price + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? UnitPrice { get => this._unitPrice; } + + /// Creates an new instance. + public PriceSheetProperties() + { + + } + } + /// The properties of the price sheet. + public partial interface IPriceSheetProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The id of the billing period resource that the usage belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The id of the billing period resource that the usage belongs to.", + SerializedName = @"billingPeriodId", + PossibleTypes = new [] { typeof(string) })] + string BillingPeriodId { get; } + /// Currency Code + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Currency Code", + SerializedName = @"currencyCode", + PossibleTypes = new [] { typeof(string) })] + string CurrencyCode { get; } + /// Included quality for an offer + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Included quality for an offer", + SerializedName = @"includedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? IncludedQuantity { get; } + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The category of the meter, for example, 'Cloud services', 'Networking', etc..", + SerializedName = @"meterCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailMeterCategory { get; } + /// The location in which the Azure service is available. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The location in which the Azure service is available.", + SerializedName = @"meterLocation", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailMeterLocation { get; } + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the meter, within the given meter category", + SerializedName = @"meterName", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailMeterName { get; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc..", + SerializedName = @"meterSubCategory", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailMeterSubCategory { get; } + /// The pretax listing price. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The pretax listing price.", + SerializedName = @"pretaxStandardRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MeterDetailPretaxStandardRate { get; } + /// The name of the service. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the service.", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailServiceName { get; } + /// The service tier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The service tier.", + SerializedName = @"serviceTier", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailServiceTier { get; } + /// The total included quantity associated with the offer. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total included quantity associated with the offer.", + SerializedName = @"totalIncludedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MeterDetailTotalIncludedQuantity { get; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string MeterDetailUnit { get; } + /// The meter id (GUID) + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter id (GUID)", + SerializedName = @"meterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// Offer Id + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Offer Id", + SerializedName = @"offerId", + PossibleTypes = new [] { typeof(string) })] + string OfferId { get; } + /// Part Number + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Part Number", + SerializedName = @"partNumber", + PossibleTypes = new [] { typeof(string) })] + string PartNumber { get; } + /// Unit of measure + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unit of measure", + SerializedName = @"unitOfMeasure", + PossibleTypes = new [] { typeof(string) })] + string UnitOfMeasure { get; } + /// Unit Price + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unit Price", + SerializedName = @"unitPrice", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UnitPrice { get; } + + } + /// The properties of the price sheet. + internal partial interface IPriceSheetPropertiesInternal + + { + /// The id of the billing period resource that the usage belongs to. + string BillingPeriodId { get; set; } + /// Currency Code + string CurrencyCode { get; set; } + /// Included quality for an offer + decimal? IncludedQuantity { get; set; } + /// + /// The details about the meter. By default this is not populated, unless it's specified in $expand. + /// + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails MeterDetail { get; set; } + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + string MeterDetailMeterCategory { get; set; } + /// The location in which the Azure service is available. + string MeterDetailMeterLocation { get; set; } + /// The name of the meter, within the given meter category + string MeterDetailMeterName { get; set; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + string MeterDetailMeterSubCategory { get; set; } + /// The pretax listing price. + decimal? MeterDetailPretaxStandardRate { get; set; } + /// The name of the service. + string MeterDetailServiceName { get; set; } + /// The service tier. + string MeterDetailServiceTier { get; set; } + /// The total included quantity associated with the offer. + decimal? MeterDetailTotalIncludedQuantity { get; set; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + string MeterDetailUnit { get; set; } + /// The meter id (GUID) + string MeterId { get; set; } + /// Offer Id + string OfferId { get; set; } + /// Part Number + string PartNumber { get; set; } + /// Unit of measure + string UnitOfMeasure { get; set; } + /// Unit Price + decimal? UnitPrice { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetProperties.json.cs new file mode 100644 index 000000000000..55a4035f8c22 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetProperties.json.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the price sheet. + public partial class PriceSheetProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new PriceSheetProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal PriceSheetProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_meterDetail = If( json?.PropertyT("meterDetails"), out var __jsonMeterDetails) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetails.FromJson(__jsonMeterDetails) : MeterDetail;} + {_billingPeriodId = If( json?.PropertyT("billingPeriodId"), out var __jsonBillingPeriodId) ? (string)__jsonBillingPeriodId : (string)BillingPeriodId;} + {_meterId = If( json?.PropertyT("meterId"), out var __jsonMeterId) ? (string)__jsonMeterId : (string)MeterId;} + {_unitOfMeasure = If( json?.PropertyT("unitOfMeasure"), out var __jsonUnitOfMeasure) ? (string)__jsonUnitOfMeasure : (string)UnitOfMeasure;} + {_includedQuantity = If( json?.PropertyT("includedQuantity"), out var __jsonIncludedQuantity) ? (decimal?)__jsonIncludedQuantity : IncludedQuantity;} + {_partNumber = If( json?.PropertyT("partNumber"), out var __jsonPartNumber) ? (string)__jsonPartNumber : (string)PartNumber;} + {_unitPrice = If( json?.PropertyT("unitPrice"), out var __jsonUnitPrice) ? (decimal?)__jsonUnitPrice : UnitPrice;} + {_currencyCode = If( json?.PropertyT("currencyCode"), out var __jsonCurrencyCode) ? (string)__jsonCurrencyCode : (string)CurrencyCode;} + {_offerId = If( json?.PropertyT("offerId"), out var __jsonOfferId) ? (string)__jsonOfferId : (string)OfferId;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._meterDetail ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._meterDetail.ToJson(null,serializationMode) : null, "meterDetails" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._billingPeriodId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingPeriodId.ToString()) : null, "billingPeriodId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._meterId.ToString()) : null, "meterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._unitOfMeasure)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._unitOfMeasure.ToString()) : null, "unitOfMeasure" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._includedQuantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._includedQuantity) : null, "includedQuantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._partNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._partNumber.ToString()) : null, "partNumber" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._unitPrice ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._unitPrice) : null, "unitPrice" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currencyCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._currencyCode.ToString()) : null, "currencyCode" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._offerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._offerId.ToString()) : null, "offerId" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetResult.PowerShell.cs new file mode 100644 index 000000000000..36937219912c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetResult.PowerShell.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// An pricesheet resource. + [System.ComponentModel.TypeConverter(typeof(PriceSheetResultTypeConverter))] + public partial class PriceSheetResult + { + + /// + /// 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.Consumption.Models.Api20211001.IPriceSheetResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PriceSheetResult(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.Consumption.Models.Api20211001.IPriceSheetResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PriceSheetResult(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.Consumption.Models.Api20211001.IPriceSheetResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PriceSheetResult(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.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModel) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetModelTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Download")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).Download = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails) content.GetValueForProperty("Download",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).Download, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Pricesheet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).Pricesheet = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[]) content.GetValueForProperty("Pricesheet",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).Pricesheet, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterName = (string) content.GetValueForProperty("DownloadMeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterName, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterCategory = (string) content.GetValueForProperty("DownloadMeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterCategory, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterSubCategory = (string) content.GetValueForProperty("DownloadMeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("DownloadUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadUnit = (string) content.GetValueForProperty("DownloadUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadUnit, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterLocation = (string) content.GetValueForProperty("DownloadMeterLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterLocation, global::System.Convert.ToString); + } + if (content.Contains("DownloadTotalIncludedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadTotalIncludedQuantity = (decimal?) content.GetValueForProperty("DownloadTotalIncludedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadTotalIncludedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DownloadPretaxStandardRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadPretaxStandardRate = (decimal?) content.GetValueForProperty("DownloadPretaxStandardRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadPretaxStandardRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DownloadServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadServiceName = (string) content.GetValueForProperty("DownloadServiceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadServiceName, global::System.Convert.ToString); + } + if (content.Contains("DownloadServiceTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadServiceTier = (string) content.GetValueForProperty("DownloadServiceTier",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadServiceTier, 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 PriceSheetResult(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.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModel) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetModelTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Download")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).Download = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails) content.GetValueForProperty("Download",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).Download, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.MeterDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Pricesheet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).Pricesheet = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[]) content.GetValueForProperty("Pricesheet",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).Pricesheet, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterName = (string) content.GetValueForProperty("DownloadMeterName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterName, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterCategory = (string) content.GetValueForProperty("DownloadMeterCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterCategory, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterSubCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterSubCategory = (string) content.GetValueForProperty("DownloadMeterSubCategory",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterSubCategory, global::System.Convert.ToString); + } + if (content.Contains("DownloadUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadUnit = (string) content.GetValueForProperty("DownloadUnit",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadUnit, global::System.Convert.ToString); + } + if (content.Contains("DownloadMeterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterLocation = (string) content.GetValueForProperty("DownloadMeterLocation",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadMeterLocation, global::System.Convert.ToString); + } + if (content.Contains("DownloadTotalIncludedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadTotalIncludedQuantity = (decimal?) content.GetValueForProperty("DownloadTotalIncludedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadTotalIncludedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DownloadPretaxStandardRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadPretaxStandardRate = (decimal?) content.GetValueForProperty("DownloadPretaxStandardRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadPretaxStandardRate, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DownloadServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadServiceName = (string) content.GetValueForProperty("DownloadServiceName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadServiceName, global::System.Convert.ToString); + } + if (content.Contains("DownloadServiceTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadServiceTier = (string) content.GetValueForProperty("DownloadServiceTier",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal)this).DownloadServiceTier, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An pricesheet resource. + [System.ComponentModel.TypeConverter(typeof(PriceSheetResultTypeConverter))] + public partial interface IPriceSheetResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetResult.TypeConverter.cs new file mode 100644 index 000000000000..80d1d342fd0c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PriceSheetResultTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IPriceSheetResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PriceSheetResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PriceSheetResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PriceSheetResult.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/consumption/generated/api/Models/Api20211001/PriceSheetResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetResult.cs new file mode 100644 index 000000000000..694ebe87d65d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetResult.cs @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// An pricesheet resource. + public partial class PriceSheetResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(); + + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadMeterCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadMeterCategory; } + + /// The location in which the Azure service is available. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadMeterLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadMeterLocation; } + + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadMeterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadMeterName; } + + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadMeterSubCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadMeterSubCategory; } + + /// The pretax listing price. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? DownloadPretaxStandardRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadPretaxStandardRate; } + + /// The name of the service. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadServiceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadServiceName; } + + /// The service tier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadServiceTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadServiceTier; } + + /// The total included quantity associated with the offer. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? DownloadTotalIncludedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadTotalIncludedQuantity; } + + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DownloadUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadUnit; } + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Download + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.Download { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).Download; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).Download = value; } + + /// Internal Acessors for DownloadMeterCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.DownloadMeterCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadMeterCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadMeterCategory = value; } + + /// Internal Acessors for DownloadMeterLocation + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.DownloadMeterLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadMeterLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadMeterLocation = value; } + + /// Internal Acessors for DownloadMeterName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.DownloadMeterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadMeterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadMeterName = value; } + + /// Internal Acessors for DownloadMeterSubCategory + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.DownloadMeterSubCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadMeterSubCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadMeterSubCategory = value; } + + /// Internal Acessors for DownloadPretaxStandardRate + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.DownloadPretaxStandardRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadPretaxStandardRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadPretaxStandardRate = value; } + + /// Internal Acessors for DownloadServiceName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.DownloadServiceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadServiceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadServiceName = value; } + + /// Internal Acessors for DownloadServiceTier + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.DownloadServiceTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadServiceTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadServiceTier = value; } + + /// Internal Acessors for DownloadTotalIncludedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.DownloadTotalIncludedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadTotalIncludedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadTotalIncludedQuantity = value; } + + /// Internal Acessors for DownloadUnit + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.DownloadUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).DownloadUnit = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).NextLink = value; } + + /// Internal Acessors for Pricesheet + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.Pricesheet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).Pricesheet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).Pricesheet = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModel Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetModel()); set { {_property = value;} } } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).NextLink; } + + /// Price sheet + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[] Pricesheet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModelInternal)Property).Pricesheet; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModel _property; + + /// price sheet result. It contains the pricesheet associated with billing period + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModel Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetModel()); set => this._property = value; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public PriceSheetResult() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// An pricesheet resource. + public partial interface IPriceSheetResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource + { + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The category of the meter, for example, 'Cloud services', 'Networking', etc..", + SerializedName = @"meterCategory", + PossibleTypes = new [] { typeof(string) })] + string DownloadMeterCategory { get; } + /// The location in which the Azure service is available. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The location in which the Azure service is available.", + SerializedName = @"meterLocation", + PossibleTypes = new [] { typeof(string) })] + string DownloadMeterLocation { get; } + /// The name of the meter, within the given meter category + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the meter, within the given meter category", + SerializedName = @"meterName", + PossibleTypes = new [] { typeof(string) })] + string DownloadMeterName { get; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc..", + SerializedName = @"meterSubCategory", + PossibleTypes = new [] { typeof(string) })] + string DownloadMeterSubCategory { get; } + /// The pretax listing price. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The pretax listing price.", + SerializedName = @"pretaxStandardRate", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DownloadPretaxStandardRate { get; } + /// The name of the service. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the service.", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + string DownloadServiceName { get; } + /// The service tier. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The service tier.", + SerializedName = @"serviceTier", + PossibleTypes = new [] { typeof(string) })] + string DownloadServiceTier { get; } + /// The total included quantity associated with the offer. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total included quantity associated with the offer.", + SerializedName = @"totalIncludedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DownloadTotalIncludedQuantity { get; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string DownloadUnit { get; } + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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; } + /// Price sheet + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Price sheet", + SerializedName = @"pricesheets", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[] Pricesheet { get; } + + } + /// An pricesheet resource. + internal partial interface IPriceSheetResultInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal + { + /// Pricesheet download details. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMeterDetails Download { get; set; } + /// The category of the meter, for example, 'Cloud services', 'Networking', etc.. + string DownloadMeterCategory { get; set; } + /// The location in which the Azure service is available. + string DownloadMeterLocation { get; set; } + /// The name of the meter, within the given meter category + string DownloadMeterName { get; set; } + /// + /// The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + /// + string DownloadMeterSubCategory { get; set; } + /// The pretax listing price. + decimal? DownloadPretaxStandardRate { get; set; } + /// The name of the service. + string DownloadServiceName { get; set; } + /// The service tier. + string DownloadServiceTier { get; set; } + /// The total included quantity associated with the offer. + decimal? DownloadTotalIncludedQuantity { get; set; } + /// + /// The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + /// + string DownloadUnit { get; set; } + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// Price sheet + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetProperties[] Pricesheet { get; set; } + /// price sheet result. It contains the pricesheet associated with billing period + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetModel Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetResult.json.cs new file mode 100644 index 000000000000..d8f98f81a613 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/PriceSheetResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// An pricesheet resource. + public partial class PriceSheetResult + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new PriceSheetResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal PriceSheetResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.PriceSheetModel.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/ProxyResource.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ProxyResource.PowerShell.cs new file mode 100644 index 000000000000..2fb723922863 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/ProxyResource.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ProxyResource.TypeConverter.cs new file mode 100644 index 000000000000..bb3496aab8f0 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IProxyResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ProxyResource.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ProxyResource.cs new file mode 100644 index 000000000000..98fcb53eee55 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The Resource model definition. + public partial class ProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _type; + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Id.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ProxyResource.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ProxyResource.json.cs new file mode 100644 index 000000000000..32d6876063bb --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ProxyResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AddIf( null != (((object)this._eTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/Reseller.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Reseller.PowerShell.cs new file mode 100644 index 000000000000..cfd1c25633cf --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Reseller.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The reseller properties. + [System.ComponentModel.TypeConverter(typeof(ResellerTypeConverter))] + public partial class Reseller + { + + /// + /// 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.Consumption.Models.Api20211001.IReseller DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Reseller(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.Consumption.Models.Api20211001.IReseller DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Reseller(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.Consumption.Models.Api20211001.IReseller FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Reseller(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.Consumption.Models.Api20211001.IResellerInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)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 Reseller(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.Consumption.Models.Api20211001.IResellerInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal)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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The reseller properties. + [System.ComponentModel.TypeConverter(typeof(ResellerTypeConverter))] + public partial interface IReseller + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Reseller.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Reseller.TypeConverter.cs new file mode 100644 index 000000000000..d6e6abdb463c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Reseller.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResellerTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReseller ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Reseller.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Reseller.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Reseller.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/consumption/generated/api/Models/Api20211001/Reseller.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Reseller.cs new file mode 100644 index 000000000000..ebb9cab644c2 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Reseller.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The reseller properties. + public partial class Reseller : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal + { + + /// Backing field for property. + private string _description; + + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Backing field for property. + private string _id; + + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResellerInternal.Id { get => this._id; set { {_id = value;} } } + + /// Creates an new instance. + public Reseller() + { + + } + } + /// The reseller properties. + public partial interface IReseller : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The reseller property description. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property description.", + SerializedName = @"resellerDescription", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// The reseller property ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reseller property ID.", + SerializedName = @"resellerId", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + + } + /// The reseller properties. + internal partial interface IResellerInternal + + { + /// The reseller property description. + string Description { get; set; } + /// The reseller property ID. + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Reseller.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Reseller.json.cs new file mode 100644 index 000000000000..c4031540adcd --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Reseller.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The reseller properties. + public partial class Reseller + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReseller FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new Reseller(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal Reseller(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("resellerId"), out var __jsonResellerId) ? (string)__jsonResellerId : (string)Id;} + {_description = If( json?.PropertyT("resellerDescription"), out var __jsonResellerDescription) ? (string)__jsonResellerDescription : (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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._id.ToString()) : null, "resellerId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._description.ToString()) : null, "resellerDescription" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetail.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetail.PowerShell.cs new file mode 100644 index 000000000000..35e3750bd01d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetail.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// reservation detail resource. + [System.ComponentModel.TypeConverter(typeof(ReservationDetailTypeConverter))] + public partial class ReservationDetail + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationDetail(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.Consumption.Models.Api20211001.IReservationDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationDetail(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.Consumption.Models.Api20211001.IReservationDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationDetail(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.Consumption.Models.Api20211001.IReservationDetailInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).InstanceFlexibilityRatio = (string) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).InstanceFlexibilityRatio, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("ReservedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).ReservedHour = (decimal?) content.GetValueForProperty("ReservedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).ReservedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).UsageDate = (global::System.DateTime?) content.GetValueForProperty("UsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).UsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UsedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).UsedHour = (decimal?) content.GetValueForProperty("UsedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).UsedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("InstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).InstanceId = (string) content.GetValueForProperty("InstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).InstanceId, global::System.Convert.ToString); + } + if (content.Contains("TotalReservedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).TotalReservedQuantity = (decimal?) content.GetValueForProperty("TotalReservedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).TotalReservedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).Kind, 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 ReservationDetail(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.Consumption.Models.Api20211001.IReservationDetailInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).InstanceFlexibilityRatio = (string) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).InstanceFlexibilityRatio, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("ReservedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).ReservedHour = (decimal?) content.GetValueForProperty("ReservedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).ReservedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).UsageDate = (global::System.DateTime?) content.GetValueForProperty("UsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).UsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UsedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).UsedHour = (decimal?) content.GetValueForProperty("UsedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).UsedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("InstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).InstanceId = (string) content.GetValueForProperty("InstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).InstanceId, global::System.Convert.ToString); + } + if (content.Contains("TotalReservedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).TotalReservedQuantity = (decimal?) content.GetValueForProperty("TotalReservedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).TotalReservedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal)this).Kind, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// reservation detail resource. + [System.ComponentModel.TypeConverter(typeof(ReservationDetailTypeConverter))] + public partial interface IReservationDetail + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetail.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetail.TypeConverter.cs new file mode 100644 index 000000000000..d153f8dc451a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetail.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationDetailTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationDetail ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationDetail.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationDetail.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationDetail.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/consumption/generated/api/Models/Api20211001/ReservationDetail.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetail.cs new file mode 100644 index 000000000000..f7a95907d7a9 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetail.cs @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// reservation detail resource. + public partial class ReservationDetail : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(); + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).InstanceFlexibilityGroup; } + + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).InstanceFlexibilityRatio; } + + /// This identifier is the name of the resource or the fully qualified Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string InstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).InstanceId; } + + /// The reservation kind. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).Kind; } + + /// Internal Acessors for InstanceFlexibilityGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal.InstanceFlexibilityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).InstanceFlexibilityGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).InstanceFlexibilityGroup = value; } + + /// Internal Acessors for InstanceFlexibilityRatio + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal.InstanceFlexibilityRatio { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).InstanceFlexibilityRatio; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).InstanceFlexibilityRatio = value; } + + /// Internal Acessors for InstanceId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal.InstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).InstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).InstanceId = value; } + + /// Internal Acessors for Kind + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal.Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).Kind = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailProperties()); set { {_property = value;} } } + + /// Internal Acessors for ReservationId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal.ReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).ReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).ReservationId = value; } + + /// Internal Acessors for ReservationOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal.ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).ReservationOrderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).ReservationOrderId = value; } + + /// Internal Acessors for ReservedHour + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal.ReservedHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).ReservedHour; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).ReservedHour = value; } + + /// Internal Acessors for SkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal.SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).SkuName = value; } + + /// Internal Acessors for TotalReservedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal.TotalReservedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).TotalReservedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).TotalReservedQuantity = value; } + + /// Internal Acessors for UsageDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal.UsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).UsageDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).UsageDate = value; } + + /// Internal Acessors for UsedHour + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailInternal.UsedHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).UsedHour; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).UsedHour = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailProperties _property; + + /// The properties of the reservation detail. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailProperties()); set => this._property = value; } + + /// + /// The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for + /// applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied + /// to. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).ReservationId; } + + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).ReservationOrderId; } + + /// + /// This is the total hours reserved for the day. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours + /// for that day and 24 hours from subsequent days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ReservedHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).ReservedHour; } + + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).SkuName; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// This is the total count of instances that are reserved for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? TotalReservedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).TotalReservedQuantity; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// The date on which consumption occurred. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? UsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).UsageDate; } + + /// This is the total hours used by the instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? UsedHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)Property).UsedHour; } + + /// Creates an new instance. + public ReservationDetail() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// reservation detail resource. + public partial interface IReservationDetail : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource + { + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instance Flexibility Group.", + SerializedName = @"instanceFlexibilityGroup", + PossibleTypes = new [] { typeof(string) })] + string InstanceFlexibilityGroup { get; } + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instance Flexibility Ratio.", + SerializedName = @"instanceFlexibilityRatio", + PossibleTypes = new [] { typeof(string) })] + string InstanceFlexibilityRatio { get; } + /// This identifier is the name of the resource or the fully qualified Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This identifier is the name of the resource or the fully qualified Resource ID.", + SerializedName = @"instanceId", + PossibleTypes = new [] { typeof(string) })] + string InstanceId { get; } + /// The reservation kind. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation kind.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + string Kind { get; } + /// + /// The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for + /// applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied + /// to. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied to.", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + string ReservationId { get; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations.", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderId { get; } + /// + /// This is the total hours reserved for the day. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours + /// for that day and 24 hours from subsequent days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the total hours reserved for the day. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent days.", + SerializedName = @"reservedHours", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ReservedHour { get; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records.", + SerializedName = @"skuName", + PossibleTypes = new [] { typeof(string) })] + string SkuName { get; } + /// This is the total count of instances that are reserved for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the total count of instances that are reserved for the reservationId.", + SerializedName = @"totalReservedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalReservedQuantity { get; } + /// The date on which consumption occurred. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date on which consumption occurred.", + SerializedName = @"usageDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageDate { get; } + /// This is the total hours used by the instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the total hours used by the instance.", + SerializedName = @"usedHours", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UsedHour { get; } + + } + /// reservation detail resource. + internal partial interface IReservationDetailInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal + { + /// The instance Flexibility Group. + string InstanceFlexibilityGroup { get; set; } + /// The instance Flexibility Ratio. + string InstanceFlexibilityRatio { get; set; } + /// This identifier is the name of the resource or the fully qualified Resource ID. + string InstanceId { get; set; } + /// The reservation kind. + string Kind { get; set; } + /// The properties of the reservation detail. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailProperties Property { get; set; } + /// + /// The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for + /// applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied + /// to. + /// + string ReservationId { get; set; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + string ReservationOrderId { get; set; } + /// + /// This is the total hours reserved for the day. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours + /// for that day and 24 hours from subsequent days. + /// + decimal? ReservedHour { get; set; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + string SkuName { get; set; } + /// This is the total count of instances that are reserved for the reservationId. + decimal? TotalReservedQuantity { get; set; } + /// The date on which consumption occurred. + global::System.DateTime? UsageDate { get; set; } + /// This is the total hours used by the instance. + decimal? UsedHour { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetail.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetail.json.cs new file mode 100644 index 000000000000..8e444c280616 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetail.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// reservation detail resource. + public partial class ReservationDetail + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationDetail(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationDetail(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/ReservationDetailProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailProperties.PowerShell.cs new file mode 100644 index 000000000000..79d74492afcc --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the reservation detail. + [System.ComponentModel.TypeConverter(typeof(ReservationDetailPropertiesTypeConverter))] + public partial class ReservationDetailProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationDetailProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationDetailProperties(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.Consumption.Models.Api20211001.IReservationDetailProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationDetailProperties(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.Consumption.Models.Api20211001.IReservationDetailProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationDetailProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).InstanceFlexibilityRatio = (string) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).InstanceFlexibilityRatio, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("ReservedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).ReservedHour = (decimal?) content.GetValueForProperty("ReservedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).ReservedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).UsageDate = (global::System.DateTime?) content.GetValueForProperty("UsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).UsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UsedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).UsedHour = (decimal?) content.GetValueForProperty("UsedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).UsedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("InstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).InstanceId = (string) content.GetValueForProperty("InstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).InstanceId, global::System.Convert.ToString); + } + if (content.Contains("TotalReservedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).TotalReservedQuantity = (decimal?) content.GetValueForProperty("TotalReservedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).TotalReservedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).Kind, 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 ReservationDetailProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityRatio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).InstanceFlexibilityRatio = (string) content.GetValueForProperty("InstanceFlexibilityRatio",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).InstanceFlexibilityRatio, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibilityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).InstanceFlexibilityGroup = (string) content.GetValueForProperty("InstanceFlexibilityGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).InstanceFlexibilityGroup, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("ReservedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).ReservedHour = (decimal?) content.GetValueForProperty("ReservedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).ReservedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).UsageDate = (global::System.DateTime?) content.GetValueForProperty("UsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).UsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UsedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).UsedHour = (decimal?) content.GetValueForProperty("UsedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).UsedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("InstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).InstanceId = (string) content.GetValueForProperty("InstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).InstanceId, global::System.Convert.ToString); + } + if (content.Contains("TotalReservedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).TotalReservedQuantity = (decimal?) content.GetValueForProperty("TotalReservedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).TotalReservedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal)this).Kind, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the reservation detail. + [System.ComponentModel.TypeConverter(typeof(ReservationDetailPropertiesTypeConverter))] + public partial interface IReservationDetailProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailProperties.TypeConverter.cs new file mode 100644 index 000000000000..a7e5e07f051b --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationDetailPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationDetailProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationDetailProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationDetailProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationDetailProperties.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/consumption/generated/api/Models/Api20211001/ReservationDetailProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailProperties.cs new file mode 100644 index 000000000000..2af01a051dbb --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailProperties.cs @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the reservation detail. + public partial class ReservationDetailProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal + { + + /// Backing field for property. + private string _instanceFlexibilityGroup; + + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InstanceFlexibilityGroup { get => this._instanceFlexibilityGroup; } + + /// Backing field for property. + private string _instanceFlexibilityRatio; + + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InstanceFlexibilityRatio { get => this._instanceFlexibilityRatio; } + + /// Backing field for property. + private string _instanceId; + + /// This identifier is the name of the resource or the fully qualified Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string InstanceId { get => this._instanceId; } + + /// Backing field for property. + private string _kind; + + /// The reservation kind. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Kind { get => this._kind; } + + /// Internal Acessors for InstanceFlexibilityGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal.InstanceFlexibilityGroup { get => this._instanceFlexibilityGroup; set { {_instanceFlexibilityGroup = value;} } } + + /// Internal Acessors for InstanceFlexibilityRatio + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal.InstanceFlexibilityRatio { get => this._instanceFlexibilityRatio; set { {_instanceFlexibilityRatio = value;} } } + + /// Internal Acessors for InstanceId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal.InstanceId { get => this._instanceId; set { {_instanceId = value;} } } + + /// Internal Acessors for Kind + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal.Kind { get => this._kind; set { {_kind = value;} } } + + /// Internal Acessors for ReservationId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal.ReservationId { get => this._reservationId; set { {_reservationId = value;} } } + + /// Internal Acessors for ReservationOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal.ReservationOrderId { get => this._reservationOrderId; set { {_reservationOrderId = value;} } } + + /// Internal Acessors for ReservedHour + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal.ReservedHour { get => this._reservedHour; set { {_reservedHour = value;} } } + + /// Internal Acessors for SkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal.SkuName { get => this._skuName; set { {_skuName = value;} } } + + /// Internal Acessors for TotalReservedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal.TotalReservedQuantity { get => this._totalReservedQuantity; set { {_totalReservedQuantity = value;} } } + + /// Internal Acessors for UsageDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal.UsageDate { get => this._usageDate; set { {_usageDate = value;} } } + + /// Internal Acessors for UsedHour + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailPropertiesInternal.UsedHour { get => this._usedHour; set { {_usedHour = value;} } } + + /// Backing field for property. + private string _reservationId; + + /// + /// The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for + /// applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied + /// to. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationId { get => this._reservationId; } + + /// Backing field for property. + private string _reservationOrderId; + + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationOrderId { get => this._reservationOrderId; } + + /// Backing field for property. + private decimal? _reservedHour; + + /// + /// This is the total hours reserved for the day. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours + /// for that day and 24 hours from subsequent days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? ReservedHour { get => this._reservedHour; } + + /// Backing field for property. + private string _skuName; + + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SkuName { get => this._skuName; } + + /// Backing field for property. + private decimal? _totalReservedQuantity; + + /// This is the total count of instances that are reserved for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? TotalReservedQuantity { get => this._totalReservedQuantity; } + + /// Backing field for property. + private global::System.DateTime? _usageDate; + + /// The date on which consumption occurred. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? UsageDate { get => this._usageDate; } + + /// Backing field for property. + private decimal? _usedHour; + + /// This is the total hours used by the instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? UsedHour { get => this._usedHour; } + + /// Creates an new instance. + public ReservationDetailProperties() + { + + } + } + /// The properties of the reservation detail. + public partial interface IReservationDetailProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The instance Flexibility Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instance Flexibility Group.", + SerializedName = @"instanceFlexibilityGroup", + PossibleTypes = new [] { typeof(string) })] + string InstanceFlexibilityGroup { get; } + /// The instance Flexibility Ratio. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instance Flexibility Ratio.", + SerializedName = @"instanceFlexibilityRatio", + PossibleTypes = new [] { typeof(string) })] + string InstanceFlexibilityRatio { get; } + /// This identifier is the name of the resource or the fully qualified Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This identifier is the name of the resource or the fully qualified Resource ID.", + SerializedName = @"instanceId", + PossibleTypes = new [] { typeof(string) })] + string InstanceId { get; } + /// The reservation kind. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation kind.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + string Kind { get; } + /// + /// The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for + /// applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied + /// to. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied to.", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + string ReservationId { get; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations.", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderId { get; } + /// + /// This is the total hours reserved for the day. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours + /// for that day and 24 hours from subsequent days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the total hours reserved for the day. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent days.", + SerializedName = @"reservedHours", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ReservedHour { get; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records.", + SerializedName = @"skuName", + PossibleTypes = new [] { typeof(string) })] + string SkuName { get; } + /// This is the total count of instances that are reserved for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the total count of instances that are reserved for the reservationId.", + SerializedName = @"totalReservedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalReservedQuantity { get; } + /// The date on which consumption occurred. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date on which consumption occurred.", + SerializedName = @"usageDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageDate { get; } + /// This is the total hours used by the instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the total hours used by the instance.", + SerializedName = @"usedHours", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UsedHour { get; } + + } + /// The properties of the reservation detail. + internal partial interface IReservationDetailPropertiesInternal + + { + /// The instance Flexibility Group. + string InstanceFlexibilityGroup { get; set; } + /// The instance Flexibility Ratio. + string InstanceFlexibilityRatio { get; set; } + /// This identifier is the name of the resource or the fully qualified Resource ID. + string InstanceId { get; set; } + /// The reservation kind. + string Kind { get; set; } + /// + /// The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for + /// applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied + /// to. + /// + string ReservationId { get; set; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + string ReservationOrderId { get; set; } + /// + /// This is the total hours reserved for the day. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours + /// for that day and 24 hours from subsequent days. + /// + decimal? ReservedHour { get; set; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + string SkuName { get; set; } + /// This is the total count of instances that are reserved for the reservationId. + decimal? TotalReservedQuantity { get; set; } + /// The date on which consumption occurred. + global::System.DateTime? UsageDate { get; set; } + /// This is the total hours used by the instance. + decimal? UsedHour { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailProperties.json.cs new file mode 100644 index 000000000000..907f1fe68c11 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailProperties.json.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the reservation detail. + public partial class ReservationDetailProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationDetailProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationDetailProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_reservationOrderId = If( json?.PropertyT("reservationOrderId"), out var __jsonReservationOrderId) ? (string)__jsonReservationOrderId : (string)ReservationOrderId;} + {_instanceFlexibilityRatio = If( json?.PropertyT("instanceFlexibilityRatio"), out var __jsonInstanceFlexibilityRatio) ? (string)__jsonInstanceFlexibilityRatio : (string)InstanceFlexibilityRatio;} + {_instanceFlexibilityGroup = If( json?.PropertyT("instanceFlexibilityGroup"), out var __jsonInstanceFlexibilityGroup) ? (string)__jsonInstanceFlexibilityGroup : (string)InstanceFlexibilityGroup;} + {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)ReservationId;} + {_skuName = If( json?.PropertyT("skuName"), out var __jsonSkuName) ? (string)__jsonSkuName : (string)SkuName;} + {_reservedHour = If( json?.PropertyT("reservedHours"), out var __jsonReservedHours) ? (decimal?)__jsonReservedHours : ReservedHour;} + {_usageDate = If( json?.PropertyT("usageDate"), out var __jsonUsageDate) ? global::System.DateTime.TryParse((string)__jsonUsageDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUsageDateValue) ? __jsonUsageDateValue : UsageDate : UsageDate;} + {_usedHour = If( json?.PropertyT("usedHours"), out var __jsonUsedHours) ? (decimal?)__jsonUsedHours : UsedHour;} + {_instanceId = If( json?.PropertyT("instanceId"), out var __jsonInstanceId) ? (string)__jsonInstanceId : (string)InstanceId;} + {_totalReservedQuantity = If( json?.PropertyT("totalReservedQuantity"), out var __jsonTotalReservedQuantity) ? (decimal?)__jsonTotalReservedQuantity : TotalReservedQuantity;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationOrderId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationOrderId.ToString()) : null, "reservationOrderId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._instanceFlexibilityRatio)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._instanceFlexibilityRatio.ToString()) : null, "instanceFlexibilityRatio" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._instanceFlexibilityGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._instanceFlexibilityGroup.ToString()) : null, "instanceFlexibilityGroup" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationId.ToString()) : null, "reservationId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._skuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._skuName.ToString()) : null, "skuName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._reservedHour ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._reservedHour) : null, "reservedHours" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usageDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._usageDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "usageDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usedHour ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._usedHour) : null, "usedHours" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._instanceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._instanceId.ToString()) : null, "instanceId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalReservedQuantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._totalReservedQuantity) : null, "totalReservedQuantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailsListResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailsListResult.PowerShell.cs new file mode 100644 index 000000000000..1e960ade8f87 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailsListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Result of listing reservation details. + [System.ComponentModel.TypeConverter(typeof(ReservationDetailsListResultTypeConverter))] + public partial class ReservationDetailsListResult + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationDetailsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationDetailsListResult(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.Consumption.Models.Api20211001.IReservationDetailsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationDetailsListResult(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.Consumption.Models.Api20211001.IReservationDetailsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationDetailsListResult(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.Consumption.Models.Api20211001.IReservationDetailsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResultInternal)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 ReservationDetailsListResult(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.Consumption.Models.Api20211001.IReservationDetailsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResultInternal)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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing reservation details. + [System.ComponentModel.TypeConverter(typeof(ReservationDetailsListResultTypeConverter))] + public partial interface IReservationDetailsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailsListResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailsListResult.TypeConverter.cs new file mode 100644 index 000000000000..eba992c87a7f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailsListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationDetailsListResultTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationDetailsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationDetailsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationDetailsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationDetailsListResult.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/consumption/generated/api/Models/Api20211001/ReservationDetailsListResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailsListResult.cs new file mode 100644 index 000000000000..b30e079cbdbb --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailsListResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing reservation details. + public partial class ReservationDetailsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResultInternal.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail[] _value; + + /// The list of reservation details. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail[] Value { get => this._value; } + + /// Creates an new instance. + public ReservationDetailsListResult() + { + + } + } + /// Result of listing reservation details. + public partial interface IReservationDetailsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 reservation details. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of reservation details.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail[] Value { get; } + + } + /// Result of listing reservation details. + internal partial interface IReservationDetailsListResultInternal + + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The list of reservation details. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailsListResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailsListResult.json.cs new file mode 100644 index 000000000000..c239b4f77ac0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationDetailsListResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing reservation details. + public partial class ReservationDetailsListResult + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetailsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationDetailsListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationDetailsListResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IReservationDetail) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationDetail.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ReservationRecommendation.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendation.PowerShell.cs new file mode 100644 index 000000000000..6d37b8f9d4cb --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendation.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// A reservation recommendation resource. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationTypeConverter))] + public partial class ReservationRecommendation + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationRecommendation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationRecommendation(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.Consumption.Models.Api20211001.IReservationRecommendation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationRecommendation(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.Consumption.Models.Api20211001.IReservationRecommendation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationRecommendation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku, 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 ReservationRecommendation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A reservation recommendation resource. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationTypeConverter))] + public partial interface IReservationRecommendation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendation.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendation.TypeConverter.cs new file mode 100644 index 000000000000..265cd7852d6f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendation.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationRecommendationTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationRecommendation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationRecommendation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationRecommendation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationRecommendation.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/consumption/generated/api/Models/Api20211001/ReservationRecommendation.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendation.cs new file mode 100644 index 000000000000..6dd2765c8cd6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendation.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A reservation recommendation resource. + public partial class ReservationRecommendation : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(); + + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributes __resourceAttributes = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceAttributes(); + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind _kind; + + /// Specifies the kind of reservation recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind Kind { get => this._kind; set => this._kind = value; } + + /// Resource location + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__resourceAttributes).Location; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__resourceAttributes).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__resourceAttributes).Location = value; } + + /// Internal Acessors for Sku + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__resourceAttributes).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__resourceAttributes).Sku = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// Resource sku + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)__resourceAttributes).Sku; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ReservationRecommendation() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__resourceAttributes), __resourceAttributes); + await eventListener.AssertObjectIsValid(nameof(__resourceAttributes), __resourceAttributes); + } + } + /// A reservation recommendation resource. + public partial interface IReservationRecommendation : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributes + { + /// Specifies the kind of reservation recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the kind of reservation recommendation.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind Kind { get; set; } + + } + /// A reservation recommendation resource. + internal partial interface IReservationRecommendationInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal + { + /// Specifies the kind of reservation recommendation. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind Kind { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendation.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendation.json.cs new file mode 100644 index 000000000000..a2d67c0d3f80 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendation.json.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A reservation recommendation resource. + public partial class ReservationRecommendation + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("kind") ) + { + case "legacy": + { + return new LegacyReservationRecommendation(json); + } + case "modern": + { + return new ModernReservationRecommendation(json); + } + } + return new ReservationRecommendation(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationRecommendation(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(json); + __resourceAttributes = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceAttributes(json); + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + __resourceAttributes?.ToJson(container, serializationMode); + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsCalculatedSavingsProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsCalculatedSavingsProperties.PowerShell.cs new file mode 100644 index 000000000000..852ac04861b9 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsCalculatedSavingsProperties.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Details of estimated savings. The costs and savings are estimated for the term. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationDetailsCalculatedSavingsPropertiesTypeConverter))] + public partial class ReservationRecommendationDetailsCalculatedSavingsProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationRecommendationDetailsCalculatedSavingsProperties(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationRecommendationDetailsCalculatedSavingsProperties(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationRecommendationDetailsCalculatedSavingsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OnDemandCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).OnDemandCost = (float?) content.GetValueForProperty("OnDemandCost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).OnDemandCost, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("OverageCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).OverageCost = (float?) content.GetValueForProperty("OverageCost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).OverageCost, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).Quantity = (float?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).Quantity, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ReservationCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).ReservationCost = (float?) content.GetValueForProperty("ReservationCost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).ReservationCost, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TotalReservationCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).TotalReservationCost = (float?) content.GetValueForProperty("TotalReservationCost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).TotalReservationCost, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ReservedUnitCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).ReservedUnitCount = (float?) content.GetValueForProperty("ReservedUnitCount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).ReservedUnitCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Saving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).Saving = (float?) content.GetValueForProperty("Saving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).Saving, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ReservationRecommendationDetailsCalculatedSavingsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OnDemandCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).OnDemandCost = (float?) content.GetValueForProperty("OnDemandCost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).OnDemandCost, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("OverageCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).OverageCost = (float?) content.GetValueForProperty("OverageCost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).OverageCost, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).Quantity = (float?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).Quantity, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ReservationCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).ReservationCost = (float?) content.GetValueForProperty("ReservationCost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).ReservationCost, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TotalReservationCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).TotalReservationCost = (float?) content.GetValueForProperty("TotalReservationCost",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).TotalReservationCost, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ReservedUnitCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).ReservedUnitCount = (float?) content.GetValueForProperty("ReservedUnitCount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).ReservedUnitCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Saving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).Saving = (float?) content.GetValueForProperty("Saving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal)this).Saving, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details of estimated savings. The costs and savings are estimated for the term. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationDetailsCalculatedSavingsPropertiesTypeConverter))] + public partial interface IReservationRecommendationDetailsCalculatedSavingsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsCalculatedSavingsProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsCalculatedSavingsProperties.TypeConverter.cs new file mode 100644 index 000000000000..c83ef28234b1 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsCalculatedSavingsProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationRecommendationDetailsCalculatedSavingsPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationRecommendationDetailsCalculatedSavingsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationRecommendationDetailsCalculatedSavingsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationRecommendationDetailsCalculatedSavingsProperties.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/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsCalculatedSavingsProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsCalculatedSavingsProperties.cs new file mode 100644 index 000000000000..8f5658d1ba4f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsCalculatedSavingsProperties.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Details of estimated savings. The costs and savings are estimated for the term. + public partial class ReservationRecommendationDetailsCalculatedSavingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal + { + + /// Internal Acessors for OnDemandCost + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal.OnDemandCost { get => this._onDemandCost; set { {_onDemandCost = value;} } } + + /// Internal Acessors for OverageCost + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal.OverageCost { get => this._overageCost; set { {_overageCost = value;} } } + + /// Internal Acessors for Quantity + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal.Quantity { get => this._quantity; set { {_quantity = value;} } } + + /// Internal Acessors for ReservationCost + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal.ReservationCost { get => this._reservationCost; set { {_reservationCost = value;} } } + + /// Internal Acessors for Saving + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal.Saving { get => this._saving; set { {_saving = value;} } } + + /// Internal Acessors for TotalReservationCost + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal.TotalReservationCost { get => this._totalReservationCost; set { {_totalReservationCost = value;} } } + + /// Backing field for property. + private float? _onDemandCost; + + /// The cost without reservation. Includes hardware and software cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? OnDemandCost { get => this._onDemandCost; } + + /// Backing field for property. + private float? _overageCost; + + /// Hardware and software cost of the resources not covered by the reservation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? OverageCost { get => this._overageCost; } + + /// Backing field for property. + private float? _quantity; + + /// The quantity for calculated savings. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? Quantity { get => this._quantity; } + + /// Backing field for property. + private float? _reservationCost; + + /// Hardware cost of the resources covered by the reservation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? ReservationCost { get => this._reservationCost; } + + /// Backing field for property. + private float? _reservedUnitCount; + + /// + /// The number of reserved units used to calculate savings. Always 1 for virtual machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? ReservedUnitCount { get => this._reservedUnitCount; set => this._reservedUnitCount = value; } + + /// Backing field for property. + private float? _saving; + + /// + /// The amount saved by purchasing the recommended quantity of reservation. This is equal to onDemandCost - totalReservationCost. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? Saving { get => this._saving; } + + /// Backing field for property. + private float? _totalReservationCost; + + /// + /// Reservation cost + software cost of the resources covered by the reservation + overage cost. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? TotalReservationCost { get => this._totalReservationCost; } + + /// + /// Creates an new instance. + /// + public ReservationRecommendationDetailsCalculatedSavingsProperties() + { + + } + } + /// Details of estimated savings. The costs and savings are estimated for the term. + public partial interface IReservationRecommendationDetailsCalculatedSavingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The cost without reservation. Includes hardware and software cost. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The cost without reservation. Includes hardware and software cost.", + SerializedName = @"onDemandCost", + PossibleTypes = new [] { typeof(float) })] + float? OnDemandCost { get; } + /// Hardware and software cost of the resources not covered by the reservation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Hardware and software cost of the resources not covered by the reservation.", + SerializedName = @"overageCost", + PossibleTypes = new [] { typeof(float) })] + float? OverageCost { get; } + /// The quantity for calculated savings. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The quantity for calculated savings.", + SerializedName = @"quantity", + PossibleTypes = new [] { typeof(float) })] + float? Quantity { get; } + /// Hardware cost of the resources covered by the reservation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Hardware cost of the resources covered by the reservation.", + SerializedName = @"reservationCost", + PossibleTypes = new [] { typeof(float) })] + float? ReservationCost { get; } + /// + /// The number of reserved units used to calculate savings. Always 1 for virtual machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The number of reserved units used to calculate savings. Always 1 for virtual machines.", + SerializedName = @"reservedUnitCount", + PossibleTypes = new [] { typeof(float) })] + float? ReservedUnitCount { get; set; } + /// + /// The amount saved by purchasing the recommended quantity of reservation. This is equal to onDemandCost - totalReservationCost. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The amount saved by purchasing the recommended quantity of reservation. This is equal to onDemandCost - totalReservationCost.", + SerializedName = @"savings", + PossibleTypes = new [] { typeof(float) })] + float? Saving { get; } + /// + /// Reservation cost + software cost of the resources covered by the reservation + overage cost. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reservation cost + software cost of the resources covered by the reservation + overage cost.", + SerializedName = @"totalReservationCost", + PossibleTypes = new [] { typeof(float) })] + float? TotalReservationCost { get; } + + } + /// Details of estimated savings. The costs and savings are estimated for the term. + internal partial interface IReservationRecommendationDetailsCalculatedSavingsPropertiesInternal + + { + /// The cost without reservation. Includes hardware and software cost. + float? OnDemandCost { get; set; } + /// Hardware and software cost of the resources not covered by the reservation. + float? OverageCost { get; set; } + /// The quantity for calculated savings. + float? Quantity { get; set; } + /// Hardware cost of the resources covered by the reservation. + float? ReservationCost { get; set; } + /// + /// The number of reserved units used to calculate savings. Always 1 for virtual machines. + /// + float? ReservedUnitCount { get; set; } + /// + /// The amount saved by purchasing the recommended quantity of reservation. This is equal to onDemandCost - totalReservationCost. + /// + float? Saving { get; set; } + /// + /// Reservation cost + software cost of the resources covered by the reservation + overage cost. + /// + float? TotalReservationCost { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsCalculatedSavingsProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsCalculatedSavingsProperties.json.cs new file mode 100644 index 000000000000..b1713a3dd25d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsCalculatedSavingsProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Details of estimated savings. The costs and savings are estimated for the term. + public partial class ReservationRecommendationDetailsCalculatedSavingsProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationRecommendationDetailsCalculatedSavingsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationRecommendationDetailsCalculatedSavingsProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_onDemandCost = If( json?.PropertyT("onDemandCost"), out var __jsonOnDemandCost) ? (float?)__jsonOnDemandCost : OnDemandCost;} + {_overageCost = If( json?.PropertyT("overageCost"), out var __jsonOverageCost) ? (float?)__jsonOverageCost : OverageCost;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (float?)__jsonQuantity : Quantity;} + {_reservationCost = If( json?.PropertyT("reservationCost"), out var __jsonReservationCost) ? (float?)__jsonReservationCost : ReservationCost;} + {_totalReservationCost = If( json?.PropertyT("totalReservationCost"), out var __jsonTotalReservationCost) ? (float?)__jsonTotalReservationCost : TotalReservationCost;} + {_reservedUnitCount = If( json?.PropertyT("reservedUnitCount"), out var __jsonReservedUnitCount) ? (float?)__jsonReservedUnitCount : ReservedUnitCount;} + {_saving = If( json?.PropertyT("savings"), out var __jsonSavings) ? (float?)__jsonSavings : Saving;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._onDemandCost ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._onDemandCost) : null, "onDemandCost" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._overageCost ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._overageCost) : null, "overageCost" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._quantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._quantity) : null, "quantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._reservationCost ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._reservationCost) : null, "reservationCost" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalReservationCost ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._totalReservationCost) : null, "totalReservationCost" ,container.Add ); + } + AddIf( null != this._reservedUnitCount ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._reservedUnitCount) : null, "reservedUnitCount" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._saving ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._saving) : null, "savings" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsModel.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsModel.PowerShell.cs new file mode 100644 index 000000000000..aa3150a3a002 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsModel.PowerShell.cs @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Reservation recommendation details. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationDetailsModelTypeConverter))] + public partial class ReservationRecommendationDetailsModel + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationRecommendationDetailsModel(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationRecommendationDetailsModel(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationRecommendationDetailsModel(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Saving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Saving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties) content.GetValueForProperty("Saving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Saving, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsSavingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Usage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Usage = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties) content.GetValueForProperty("Usage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Usage, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsUsagePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ResourceAppliedScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceAppliedScope = (string[]) content.GetValueForProperty("ResourceAppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceAppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ResourceOnDemandRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceOnDemandRate = (float?) content.GetValueForProperty("ResourceOnDemandRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceOnDemandRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResourceProduct")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceProduct = (string) content.GetValueForProperty("ResourceProduct",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceProduct, global::System.Convert.ToString); + } + if (content.Contains("ResourceRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceRegion = (string) content.GetValueForProperty("ResourceRegion",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceRegion, global::System.Convert.ToString); + } + if (content.Contains("ResourceReservationRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceReservationRate = (float?) content.GetValueForProperty("ResourceReservationRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceReservationRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("SavingCalculatedSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingCalculatedSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[]) content.GetValueForProperty("SavingCalculatedSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingCalculatedSaving, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsCalculatedSavingsPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("SavingLookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingLookBackPeriod = (int?) content.GetValueForProperty("SavingLookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingLookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SavingRecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingRecommendedQuantity = (float?) content.GetValueForProperty("SavingRecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingRecommendedQuantity, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SavingReservationOrderTerm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingReservationOrderTerm = (string) content.GetValueForProperty("SavingReservationOrderTerm",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingReservationOrderTerm, global::System.Convert.ToString); + } + if (content.Contains("SavingSavingsType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingSavingsType = (string) content.GetValueForProperty("SavingSavingsType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingSavingsType, global::System.Convert.ToString); + } + if (content.Contains("SavingUnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingUnitOfMeasure = (string) content.GetValueForProperty("SavingUnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingUnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("UsageFirstConsumptionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageFirstConsumptionDate = (string) content.GetValueForProperty("UsageFirstConsumptionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageFirstConsumptionDate, global::System.Convert.ToString); + } + if (content.Contains("UsageLastConsumptionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageLastConsumptionDate = (string) content.GetValueForProperty("UsageLastConsumptionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageLastConsumptionDate, global::System.Convert.ToString); + } + if (content.Contains("UsageLookBackUnitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageLookBackUnitType = (string) content.GetValueForProperty("UsageLookBackUnitType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageLookBackUnitType, global::System.Convert.ToString); + } + if (content.Contains("UsageData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageData = (float[]) content.GetValueForProperty("UsageData",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageData, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (float) global::System.Convert.ChangeType(__w, typeof(float)))); + } + if (content.Contains("UsageGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageGrain = (string) content.GetValueForProperty("UsageGrain",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageGrain, 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 ReservationRecommendationDetailsModel(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Saving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Saving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties) content.GetValueForProperty("Saving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Saving, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsSavingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Usage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Usage = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties) content.GetValueForProperty("Usage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Usage, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsUsagePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ResourceAppliedScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceAppliedScope = (string[]) content.GetValueForProperty("ResourceAppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceAppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ResourceOnDemandRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceOnDemandRate = (float?) content.GetValueForProperty("ResourceOnDemandRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceOnDemandRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResourceProduct")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceProduct = (string) content.GetValueForProperty("ResourceProduct",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceProduct, global::System.Convert.ToString); + } + if (content.Contains("ResourceRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceRegion = (string) content.GetValueForProperty("ResourceRegion",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceRegion, global::System.Convert.ToString); + } + if (content.Contains("ResourceReservationRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceReservationRate = (float?) content.GetValueForProperty("ResourceReservationRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceReservationRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("SavingCalculatedSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingCalculatedSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[]) content.GetValueForProperty("SavingCalculatedSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingCalculatedSaving, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsCalculatedSavingsPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("SavingLookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingLookBackPeriod = (int?) content.GetValueForProperty("SavingLookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingLookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SavingRecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingRecommendedQuantity = (float?) content.GetValueForProperty("SavingRecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingRecommendedQuantity, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SavingReservationOrderTerm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingReservationOrderTerm = (string) content.GetValueForProperty("SavingReservationOrderTerm",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingReservationOrderTerm, global::System.Convert.ToString); + } + if (content.Contains("SavingSavingsType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingSavingsType = (string) content.GetValueForProperty("SavingSavingsType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingSavingsType, global::System.Convert.ToString); + } + if (content.Contains("SavingUnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingUnitOfMeasure = (string) content.GetValueForProperty("SavingUnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).SavingUnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("UsageFirstConsumptionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageFirstConsumptionDate = (string) content.GetValueForProperty("UsageFirstConsumptionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageFirstConsumptionDate, global::System.Convert.ToString); + } + if (content.Contains("UsageLastConsumptionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageLastConsumptionDate = (string) content.GetValueForProperty("UsageLastConsumptionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageLastConsumptionDate, global::System.Convert.ToString); + } + if (content.Contains("UsageLookBackUnitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageLookBackUnitType = (string) content.GetValueForProperty("UsageLookBackUnitType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageLookBackUnitType, global::System.Convert.ToString); + } + if (content.Contains("UsageData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageData = (float[]) content.GetValueForProperty("UsageData",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageData, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (float) global::System.Convert.ChangeType(__w, typeof(float)))); + } + if (content.Contains("UsageGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageGrain = (string) content.GetValueForProperty("UsageGrain",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal)this).UsageGrain, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Reservation recommendation details. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationDetailsModelTypeConverter))] + public partial interface IReservationRecommendationDetailsModel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsModel.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsModel.TypeConverter.cs new file mode 100644 index 000000000000..c765ee089a62 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsModel.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationRecommendationDetailsModelTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationRecommendationDetailsModel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationRecommendationDetailsModel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationRecommendationDetailsModel.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/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsModel.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsModel.cs new file mode 100644 index 000000000000..0c191c121f32 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsModel.cs @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Reservation recommendation details. + public partial class ReservationRecommendationDetailsModel : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(); + + /// An ISO 4217 currency code identifier for the costs and savings + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).Currency; } + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private string _location; + + /// Resource Location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).Currency = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsProperties()); set { {_property = value;} } } + + /// Internal Acessors for Resource + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.Resource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).Resource = value; } + + /// Internal Acessors for ResourceAppliedScope + string[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.ResourceAppliedScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceAppliedScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceAppliedScope = value; } + + /// Internal Acessors for ResourceGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.ResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceGroup = value; } + + /// Internal Acessors for ResourceOnDemandRate + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.ResourceOnDemandRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceOnDemandRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceOnDemandRate = value; } + + /// Internal Acessors for ResourceProduct + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.ResourceProduct { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceProduct; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceProduct = value; } + + /// Internal Acessors for ResourceRegion + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.ResourceRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceRegion = value; } + + /// Internal Acessors for ResourceReservationRate + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.ResourceReservationRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceReservationRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceReservationRate = value; } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceType = value; } + + /// Internal Acessors for Saving + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.Saving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).Saving; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).Saving = value; } + + /// Internal Acessors for SavingLookBackPeriod + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.SavingLookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingLookBackPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingLookBackPeriod = value; } + + /// Internal Acessors for SavingRecommendedQuantity + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.SavingRecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingRecommendedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingRecommendedQuantity = value; } + + /// Internal Acessors for SavingReservationOrderTerm + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.SavingReservationOrderTerm { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingReservationOrderTerm; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingReservationOrderTerm = value; } + + /// Internal Acessors for SavingSavingsType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.SavingSavingsType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingSavingsType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingSavingsType = value; } + + /// Internal Acessors for SavingUnitOfMeasure + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.SavingUnitOfMeasure { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingUnitOfMeasure; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingUnitOfMeasure = value; } + + /// Internal Acessors for Scope + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).Scope = value; } + + /// Internal Acessors for Usage + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.Usage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).Usage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).Usage = value; } + + /// Internal Acessors for UsageData + float[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.UsageData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageData = value; } + + /// Internal Acessors for UsageFirstConsumptionDate + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.UsageFirstConsumptionDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageFirstConsumptionDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageFirstConsumptionDate = value; } + + /// Internal Acessors for UsageGrain + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.UsageGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageGrain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageGrain = value; } + + /// Internal Acessors for UsageLastConsumptionDate + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.UsageLastConsumptionDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageLastConsumptionDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageLastConsumptionDate = value; } + + /// Internal Acessors for UsageLookBackUnitType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModelInternal.UsageLookBackUnitType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageLookBackUnitType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageLookBackUnitType = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties _property; + + /// The properties of the reservation recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsProperties()); set => this._property = value; } + + /// List of subscriptions for which the reservation is applied. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string[] ResourceAppliedScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceAppliedScope; } + + /// Resource Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceGroup; } + + /// + /// Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public float? ResourceOnDemandRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceOnDemandRate; } + + /// Azure product ex: Standard_E8s_v3 etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceProduct { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceProduct; } + + /// Azure resource region ex:EastUS, WestUS etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceRegion; } + + /// Hourly reservation rate of the resource. Varies based on the term. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public float? ResourceReservationRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceReservationRate; } + + /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).ResourceType; } + + /// List of calculated savings. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[] SavingCalculatedSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingCalculatedSaving; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingCalculatedSaving = value ?? null /* arrayOf */; } + + /// Number of days of usage to look back used for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? SavingLookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingLookBackPeriod; } + + /// Number of recommended units of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public float? SavingRecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingRecommendedQuantity; } + + /// Term period of the reservation, ex: P1Y or P3Y. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SavingReservationOrderTerm { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingReservationOrderTerm; } + + /// Type of savings, ex: instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SavingSavingsType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingSavingsType; } + + /// Measurement unit ex: hour etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SavingUnitOfMeasure { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).SavingUnitOfMeasure; } + + /// Scope of the reservation, ex: Single or Shared. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).Scope; } + + /// Backing field for property. + private string _sku; + + /// Resource sku + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Sku { get => this._sku; set => this._sku = value; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// + /// The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and + /// the lastConsumptionDate. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public float[] UsageData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageData; } + + /// The first usage date used for looking back for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UsageFirstConsumptionDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageFirstConsumptionDate; } + + /// The grain of the values represented in the usage data ex: hourly. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UsageGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageGrain; } + + /// The last usage date used for looking back for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UsageLastConsumptionDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageLastConsumptionDate; } + + /// What the usage data values represent ex: virtual machine instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UsageLookBackUnitType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)Property).UsageLookBackUnitType; } + + /// Creates an new instance. + public ReservationRecommendationDetailsModel() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Reservation recommendation details. + public partial interface IReservationRecommendationDetailsModel : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource + { + /// An ISO 4217 currency code identifier for the costs and savings + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An ISO 4217 currency code identifier for the costs and savings ", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// Resource Location. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// List of subscriptions for which the reservation is applied. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of subscriptions for which the reservation is applied.", + SerializedName = @"appliedScopes", + PossibleTypes = new [] { typeof(string) })] + string[] ResourceAppliedScope { get; } + /// Resource Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Group.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; } + /// + /// Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included.", + SerializedName = @"onDemandRate", + PossibleTypes = new [] { typeof(float) })] + float? ResourceOnDemandRate { get; } + /// Azure product ex: Standard_E8s_v3 etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure product ex: Standard_E8s_v3 etc.", + SerializedName = @"product", + PossibleTypes = new [] { typeof(string) })] + string ResourceProduct { get; } + /// Azure resource region ex:EastUS, WestUS etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure resource region ex:EastUS, WestUS etc.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + string ResourceRegion { get; } + /// Hourly reservation rate of the resource. Varies based on the term. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Hourly reservation rate of the resource. Varies based on the term.", + SerializedName = @"reservationRate", + PossibleTypes = new [] { typeof(float) })] + float? ResourceReservationRate { get; } + /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The azure resource type.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; } + /// List of calculated savings. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of calculated savings.", + SerializedName = @"calculatedSavings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[] SavingCalculatedSaving { get; set; } + /// Number of days of usage to look back used for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of days of usage to look back used for computing the recommendation.", + SerializedName = @"lookBackPeriod", + PossibleTypes = new [] { typeof(int) })] + int? SavingLookBackPeriod { get; } + /// Number of recommended units of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of recommended units of the resource.", + SerializedName = @"recommendedQuantity", + PossibleTypes = new [] { typeof(float) })] + float? SavingRecommendedQuantity { get; } + /// Term period of the reservation, ex: P1Y or P3Y. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Term period of the reservation, ex: P1Y or P3Y.", + SerializedName = @"reservationOrderTerm", + PossibleTypes = new [] { typeof(string) })] + string SavingReservationOrderTerm { get; } + /// Type of savings, ex: instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of savings, ex: instance.", + SerializedName = @"savingsType", + PossibleTypes = new [] { typeof(string) })] + string SavingSavingsType { get; } + /// Measurement unit ex: hour etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Measurement unit ex: hour etc.", + SerializedName = @"unitOfMeasure", + PossibleTypes = new [] { typeof(string) })] + string SavingUnitOfMeasure { get; } + /// Scope of the reservation, ex: Single or Shared. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Scope of the reservation, ex: Single or Shared.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; } + /// Resource sku + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource sku", + SerializedName = @"sku", + PossibleTypes = new [] { typeof(string) })] + string Sku { get; set; } + /// + /// The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and + /// the lastConsumptionDate. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and the lastConsumptionDate.", + SerializedName = @"usageData", + PossibleTypes = new [] { typeof(float) })] + float[] UsageData { get; } + /// The first usage date used for looking back for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The first usage date used for looking back for computing the recommendation.", + SerializedName = @"firstConsumptionDate", + PossibleTypes = new [] { typeof(string) })] + string UsageFirstConsumptionDate { get; } + /// The grain of the values represented in the usage data ex: hourly. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The grain of the values represented in the usage data ex: hourly.", + SerializedName = @"usageGrain", + PossibleTypes = new [] { typeof(string) })] + string UsageGrain { get; } + /// The last usage date used for looking back for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The last usage date used for looking back for computing the recommendation.", + SerializedName = @"lastConsumptionDate", + PossibleTypes = new [] { typeof(string) })] + string UsageLastConsumptionDate { get; } + /// What the usage data values represent ex: virtual machine instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"What the usage data values represent ex: virtual machine instance.", + SerializedName = @"lookBackUnitType", + PossibleTypes = new [] { typeof(string) })] + string UsageLookBackUnitType { get; } + + } + /// Reservation recommendation details. + internal partial interface IReservationRecommendationDetailsModelInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal + { + /// An ISO 4217 currency code identifier for the costs and savings + string Currency { get; set; } + /// Resource Location. + string Location { get; set; } + /// The properties of the reservation recommendation. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties Property { get; set; } + /// Resource specific properties. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties Resource { get; set; } + /// List of subscriptions for which the reservation is applied. + string[] ResourceAppliedScope { get; set; } + /// Resource Group. + string ResourceGroup { get; set; } + /// + /// Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included. + /// + float? ResourceOnDemandRate { get; set; } + /// Azure product ex: Standard_E8s_v3 etc. + string ResourceProduct { get; set; } + /// Azure resource region ex:EastUS, WestUS etc. + string ResourceRegion { get; set; } + /// Hourly reservation rate of the resource. Varies based on the term. + float? ResourceReservationRate { get; set; } + /// The azure resource type. + string ResourceType { get; set; } + /// Savings information for the recommendation. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties Saving { get; set; } + /// List of calculated savings. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[] SavingCalculatedSaving { get; set; } + /// Number of days of usage to look back used for computing the recommendation. + int? SavingLookBackPeriod { get; set; } + /// Number of recommended units of the resource. + float? SavingRecommendedQuantity { get; set; } + /// Term period of the reservation, ex: P1Y or P3Y. + string SavingReservationOrderTerm { get; set; } + /// Type of savings, ex: instance. + string SavingSavingsType { get; set; } + /// Measurement unit ex: hour etc. + string SavingUnitOfMeasure { get; set; } + /// Scope of the reservation, ex: Single or Shared. + string Scope { get; set; } + /// Resource sku + string Sku { get; set; } + /// Historical usage details used to calculate the estimated savings. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties Usage { get; set; } + /// + /// The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and + /// the lastConsumptionDate. + /// + float[] UsageData { get; set; } + /// The first usage date used for looking back for computing the recommendation. + string UsageFirstConsumptionDate { get; set; } + /// The grain of the values represented in the usage data ex: hourly. + string UsageGrain { get; set; } + /// The last usage date used for looking back for computing the recommendation. + string UsageLastConsumptionDate { get; set; } + /// What the usage data values represent ex: virtual machine instance. + string UsageLookBackUnitType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsModel.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsModel.json.cs new file mode 100644 index 000000000000..71b96da99740 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsModel.json.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Reservation recommendation details. + public partial class ReservationRecommendationDetailsModel + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationRecommendationDetailsModel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationRecommendationDetailsModel(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsProperties.FromJson(__jsonProperties) : Property;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? (string)__jsonSku : (string)Sku;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != (((object)this._sku)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._sku.ToString()) : null, "sku" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsProperties.PowerShell.cs new file mode 100644 index 000000000000..a3d3e18c387e --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsProperties.PowerShell.cs @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the reservation recommendation. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationDetailsPropertiesTypeConverter))] + public partial class ReservationRecommendationDetailsProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationRecommendationDetailsProperties(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationRecommendationDetailsProperties(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationRecommendationDetailsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Saving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Saving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties) content.GetValueForProperty("Saving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Saving, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsSavingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Usage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Usage = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties) content.GetValueForProperty("Usage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Usage, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsUsagePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ResourceAppliedScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceAppliedScope = (string[]) content.GetValueForProperty("ResourceAppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceAppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ResourceOnDemandRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceOnDemandRate = (float?) content.GetValueForProperty("ResourceOnDemandRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceOnDemandRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResourceProduct")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceProduct = (string) content.GetValueForProperty("ResourceProduct",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceProduct, global::System.Convert.ToString); + } + if (content.Contains("ResourceRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceRegion = (string) content.GetValueForProperty("ResourceRegion",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceRegion, global::System.Convert.ToString); + } + if (content.Contains("ResourceReservationRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceReservationRate = (float?) content.GetValueForProperty("ResourceReservationRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceReservationRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("SavingCalculatedSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingCalculatedSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[]) content.GetValueForProperty("SavingCalculatedSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingCalculatedSaving, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsCalculatedSavingsPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("SavingLookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingLookBackPeriod = (int?) content.GetValueForProperty("SavingLookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingLookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SavingRecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingRecommendedQuantity = (float?) content.GetValueForProperty("SavingRecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingRecommendedQuantity, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SavingReservationOrderTerm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingReservationOrderTerm = (string) content.GetValueForProperty("SavingReservationOrderTerm",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingReservationOrderTerm, global::System.Convert.ToString); + } + if (content.Contains("SavingSavingsType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingSavingsType = (string) content.GetValueForProperty("SavingSavingsType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingSavingsType, global::System.Convert.ToString); + } + if (content.Contains("SavingUnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingUnitOfMeasure = (string) content.GetValueForProperty("SavingUnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingUnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("UsageFirstConsumptionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageFirstConsumptionDate = (string) content.GetValueForProperty("UsageFirstConsumptionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageFirstConsumptionDate, global::System.Convert.ToString); + } + if (content.Contains("UsageLastConsumptionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageLastConsumptionDate = (string) content.GetValueForProperty("UsageLastConsumptionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageLastConsumptionDate, global::System.Convert.ToString); + } + if (content.Contains("UsageLookBackUnitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageLookBackUnitType = (string) content.GetValueForProperty("UsageLookBackUnitType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageLookBackUnitType, global::System.Convert.ToString); + } + if (content.Contains("UsageData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageData = (float[]) content.GetValueForProperty("UsageData",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageData, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (float) global::System.Convert.ChangeType(__w, typeof(float)))); + } + if (content.Contains("UsageGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageGrain = (string) content.GetValueForProperty("UsageGrain",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageGrain, 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 ReservationRecommendationDetailsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Saving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Saving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties) content.GetValueForProperty("Saving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Saving, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsSavingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Usage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Usage = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties) content.GetValueForProperty("Usage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Usage, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsUsagePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ResourceAppliedScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceAppliedScope = (string[]) content.GetValueForProperty("ResourceAppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceAppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ResourceOnDemandRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceOnDemandRate = (float?) content.GetValueForProperty("ResourceOnDemandRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceOnDemandRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResourceProduct")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceProduct = (string) content.GetValueForProperty("ResourceProduct",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceProduct, global::System.Convert.ToString); + } + if (content.Contains("ResourceRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceRegion = (string) content.GetValueForProperty("ResourceRegion",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceRegion, global::System.Convert.ToString); + } + if (content.Contains("ResourceReservationRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceReservationRate = (float?) content.GetValueForProperty("ResourceReservationRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceReservationRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("SavingCalculatedSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingCalculatedSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[]) content.GetValueForProperty("SavingCalculatedSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingCalculatedSaving, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsCalculatedSavingsPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("SavingLookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingLookBackPeriod = (int?) content.GetValueForProperty("SavingLookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingLookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SavingRecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingRecommendedQuantity = (float?) content.GetValueForProperty("SavingRecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingRecommendedQuantity, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SavingReservationOrderTerm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingReservationOrderTerm = (string) content.GetValueForProperty("SavingReservationOrderTerm",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingReservationOrderTerm, global::System.Convert.ToString); + } + if (content.Contains("SavingSavingsType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingSavingsType = (string) content.GetValueForProperty("SavingSavingsType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingSavingsType, global::System.Convert.ToString); + } + if (content.Contains("SavingUnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingUnitOfMeasure = (string) content.GetValueForProperty("SavingUnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).SavingUnitOfMeasure, global::System.Convert.ToString); + } + if (content.Contains("UsageFirstConsumptionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageFirstConsumptionDate = (string) content.GetValueForProperty("UsageFirstConsumptionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageFirstConsumptionDate, global::System.Convert.ToString); + } + if (content.Contains("UsageLastConsumptionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageLastConsumptionDate = (string) content.GetValueForProperty("UsageLastConsumptionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageLastConsumptionDate, global::System.Convert.ToString); + } + if (content.Contains("UsageLookBackUnitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageLookBackUnitType = (string) content.GetValueForProperty("UsageLookBackUnitType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageLookBackUnitType, global::System.Convert.ToString); + } + if (content.Contains("UsageData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageData = (float[]) content.GetValueForProperty("UsageData",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageData, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (float) global::System.Convert.ChangeType(__w, typeof(float)))); + } + if (content.Contains("UsageGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageGrain = (string) content.GetValueForProperty("UsageGrain",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal)this).UsageGrain, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the reservation recommendation. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationDetailsPropertiesTypeConverter))] + public partial interface IReservationRecommendationDetailsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsProperties.TypeConverter.cs new file mode 100644 index 000000000000..74effddfb603 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationRecommendationDetailsPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationRecommendationDetailsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationRecommendationDetailsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationRecommendationDetailsProperties.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/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsProperties.cs new file mode 100644 index 000000000000..44b3039b9626 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the reservation recommendation. + public partial class ReservationRecommendationDetailsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal + { + + /// Backing field for property. + private string _currency; + + /// An ISO 4217 currency code identifier for the costs and savings + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Currency { get => this._currency; } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.Currency { get => this._currency; set { {_currency = value;} } } + + /// Internal Acessors for Resource + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.Resource { get => (this._resource = this._resource ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsResourceProperties()); set { {_resource = value;} } } + + /// Internal Acessors for ResourceAppliedScope + string[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.ResourceAppliedScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).AppliedScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).AppliedScope = value; } + + /// Internal Acessors for ResourceGroup + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.ResourceGroup { get => this._resourceGroup; set { {_resourceGroup = value;} } } + + /// Internal Acessors for ResourceOnDemandRate + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.ResourceOnDemandRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).OnDemandRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).OnDemandRate = value; } + + /// Internal Acessors for ResourceProduct + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.ResourceProduct { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).Product; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).Product = value; } + + /// Internal Acessors for ResourceRegion + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.ResourceRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).Region; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).Region = value; } + + /// Internal Acessors for ResourceReservationRate + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.ResourceReservationRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).ReservationRate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).ReservationRate = value; } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).ResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).ResourceType = value; } + + /// Internal Acessors for Saving + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.Saving { get => (this._saving = this._saving ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsSavingsProperties()); set { {_saving = value;} } } + + /// Internal Acessors for SavingLookBackPeriod + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.SavingLookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).LookBackPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).LookBackPeriod = value; } + + /// Internal Acessors for SavingRecommendedQuantity + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.SavingRecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).RecommendedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).RecommendedQuantity = value; } + + /// Internal Acessors for SavingReservationOrderTerm + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.SavingReservationOrderTerm { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).ReservationOrderTerm; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).ReservationOrderTerm = value; } + + /// Internal Acessors for SavingSavingsType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.SavingSavingsType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).SavingsType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).SavingsType = value; } + + /// Internal Acessors for SavingUnitOfMeasure + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.SavingUnitOfMeasure { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).UnitOfMeasure; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).UnitOfMeasure = value; } + + /// Internal Acessors for Scope + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + + /// Internal Acessors for Usage + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.Usage { get => (this._usage = this._usage ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsUsageProperties()); set { {_usage = value;} } } + + /// Internal Acessors for UsageData + float[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.UsageData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).UsageData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).UsageData = value; } + + /// Internal Acessors for UsageFirstConsumptionDate + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.UsageFirstConsumptionDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).FirstConsumptionDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).FirstConsumptionDate = value; } + + /// Internal Acessors for UsageGrain + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.UsageGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).UsageGrain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).UsageGrain = value; } + + /// Internal Acessors for UsageLastConsumptionDate + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.UsageLastConsumptionDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).LastConsumptionDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).LastConsumptionDate = value; } + + /// Internal Acessors for UsageLookBackUnitType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsPropertiesInternal.UsageLookBackUnitType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).LookBackUnitType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).LookBackUnitType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties _resource; + + /// Resource specific properties. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties Resource { get => (this._resource = this._resource ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsResourceProperties()); } + + /// List of subscriptions for which the reservation is applied. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string[] ResourceAppliedScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).AppliedScope; } + + /// Backing field for property. + private string _resourceGroup; + + /// Resource Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceGroup { get => this._resourceGroup; } + + /// + /// Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public float? ResourceOnDemandRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).OnDemandRate; } + + /// Azure product ex: Standard_E8s_v3 etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceProduct { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).Product; } + + /// Azure resource region ex:EastUS, WestUS etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).Region; } + + /// Hourly reservation rate of the resource. Varies based on the term. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public float? ResourceReservationRate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).ReservationRate; } + + /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)Resource).ResourceType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties _saving; + + /// Savings information for the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties Saving { get => (this._saving = this._saving ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsSavingsProperties()); } + + /// List of calculated savings. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[] SavingCalculatedSaving { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).CalculatedSaving; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).CalculatedSaving = value ?? null /* arrayOf */; } + + /// Number of days of usage to look back used for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? SavingLookBackPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).LookBackPeriod; } + + /// Number of recommended units of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public float? SavingRecommendedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).RecommendedQuantity; } + + /// Term period of the reservation, ex: P1Y or P3Y. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SavingReservationOrderTerm { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).ReservationOrderTerm; } + + /// Type of savings, ex: instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SavingSavingsType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).SavingsType; } + + /// Measurement unit ex: hour etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SavingUnitOfMeasure { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)Saving).UnitOfMeasure; } + + /// Backing field for property. + private string _scope; + + /// Scope of the reservation, ex: Single or Shared. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Scope { get => this._scope; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties _usage; + + /// Historical usage details used to calculate the estimated savings. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties Usage { get => (this._usage = this._usage ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsUsageProperties()); } + + /// + /// The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and + /// the lastConsumptionDate. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public float[] UsageData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).UsageData; } + + /// The first usage date used for looking back for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UsageFirstConsumptionDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).FirstConsumptionDate; } + + /// The grain of the values represented in the usage data ex: hourly. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UsageGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).UsageGrain; } + + /// The last usage date used for looking back for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UsageLastConsumptionDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).LastConsumptionDate; } + + /// What the usage data values represent ex: virtual machine instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string UsageLookBackUnitType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)Usage).LookBackUnitType; } + + /// + /// Creates an new instance. + /// + public ReservationRecommendationDetailsProperties() + { + + } + } + /// The properties of the reservation recommendation. + public partial interface IReservationRecommendationDetailsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// An ISO 4217 currency code identifier for the costs and savings + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An ISO 4217 currency code identifier for the costs and savings ", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// List of subscriptions for which the reservation is applied. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of subscriptions for which the reservation is applied.", + SerializedName = @"appliedScopes", + PossibleTypes = new [] { typeof(string) })] + string[] ResourceAppliedScope { get; } + /// Resource Group. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Group.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; } + /// + /// Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included.", + SerializedName = @"onDemandRate", + PossibleTypes = new [] { typeof(float) })] + float? ResourceOnDemandRate { get; } + /// Azure product ex: Standard_E8s_v3 etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure product ex: Standard_E8s_v3 etc.", + SerializedName = @"product", + PossibleTypes = new [] { typeof(string) })] + string ResourceProduct { get; } + /// Azure resource region ex:EastUS, WestUS etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure resource region ex:EastUS, WestUS etc.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + string ResourceRegion { get; } + /// Hourly reservation rate of the resource. Varies based on the term. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Hourly reservation rate of the resource. Varies based on the term.", + SerializedName = @"reservationRate", + PossibleTypes = new [] { typeof(float) })] + float? ResourceReservationRate { get; } + /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The azure resource type.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; } + /// List of calculated savings. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of calculated savings.", + SerializedName = @"calculatedSavings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[] SavingCalculatedSaving { get; set; } + /// Number of days of usage to look back used for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of days of usage to look back used for computing the recommendation.", + SerializedName = @"lookBackPeriod", + PossibleTypes = new [] { typeof(int) })] + int? SavingLookBackPeriod { get; } + /// Number of recommended units of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of recommended units of the resource.", + SerializedName = @"recommendedQuantity", + PossibleTypes = new [] { typeof(float) })] + float? SavingRecommendedQuantity { get; } + /// Term period of the reservation, ex: P1Y or P3Y. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Term period of the reservation, ex: P1Y or P3Y.", + SerializedName = @"reservationOrderTerm", + PossibleTypes = new [] { typeof(string) })] + string SavingReservationOrderTerm { get; } + /// Type of savings, ex: instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of savings, ex: instance.", + SerializedName = @"savingsType", + PossibleTypes = new [] { typeof(string) })] + string SavingSavingsType { get; } + /// Measurement unit ex: hour etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Measurement unit ex: hour etc.", + SerializedName = @"unitOfMeasure", + PossibleTypes = new [] { typeof(string) })] + string SavingUnitOfMeasure { get; } + /// Scope of the reservation, ex: Single or Shared. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Scope of the reservation, ex: Single or Shared.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; } + /// + /// The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and + /// the lastConsumptionDate. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and the lastConsumptionDate.", + SerializedName = @"usageData", + PossibleTypes = new [] { typeof(float) })] + float[] UsageData { get; } + /// The first usage date used for looking back for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The first usage date used for looking back for computing the recommendation.", + SerializedName = @"firstConsumptionDate", + PossibleTypes = new [] { typeof(string) })] + string UsageFirstConsumptionDate { get; } + /// The grain of the values represented in the usage data ex: hourly. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The grain of the values represented in the usage data ex: hourly.", + SerializedName = @"usageGrain", + PossibleTypes = new [] { typeof(string) })] + string UsageGrain { get; } + /// The last usage date used for looking back for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The last usage date used for looking back for computing the recommendation.", + SerializedName = @"lastConsumptionDate", + PossibleTypes = new [] { typeof(string) })] + string UsageLastConsumptionDate { get; } + /// What the usage data values represent ex: virtual machine instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"What the usage data values represent ex: virtual machine instance.", + SerializedName = @"lookBackUnitType", + PossibleTypes = new [] { typeof(string) })] + string UsageLookBackUnitType { get; } + + } + /// The properties of the reservation recommendation. + internal partial interface IReservationRecommendationDetailsPropertiesInternal + + { + /// An ISO 4217 currency code identifier for the costs and savings + string Currency { get; set; } + /// Resource specific properties. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties Resource { get; set; } + /// List of subscriptions for which the reservation is applied. + string[] ResourceAppliedScope { get; set; } + /// Resource Group. + string ResourceGroup { get; set; } + /// + /// Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included. + /// + float? ResourceOnDemandRate { get; set; } + /// Azure product ex: Standard_E8s_v3 etc. + string ResourceProduct { get; set; } + /// Azure resource region ex:EastUS, WestUS etc. + string ResourceRegion { get; set; } + /// Hourly reservation rate of the resource. Varies based on the term. + float? ResourceReservationRate { get; set; } + /// The azure resource type. + string ResourceType { get; set; } + /// Savings information for the recommendation. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties Saving { get; set; } + /// List of calculated savings. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[] SavingCalculatedSaving { get; set; } + /// Number of days of usage to look back used for computing the recommendation. + int? SavingLookBackPeriod { get; set; } + /// Number of recommended units of the resource. + float? SavingRecommendedQuantity { get; set; } + /// Term period of the reservation, ex: P1Y or P3Y. + string SavingReservationOrderTerm { get; set; } + /// Type of savings, ex: instance. + string SavingSavingsType { get; set; } + /// Measurement unit ex: hour etc. + string SavingUnitOfMeasure { get; set; } + /// Scope of the reservation, ex: Single or Shared. + string Scope { get; set; } + /// Historical usage details used to calculate the estimated savings. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties Usage { get; set; } + /// + /// The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and + /// the lastConsumptionDate. + /// + float[] UsageData { get; set; } + /// The first usage date used for looking back for computing the recommendation. + string UsageFirstConsumptionDate { get; set; } + /// The grain of the values represented in the usage data ex: hourly. + string UsageGrain { get; set; } + /// The last usage date used for looking back for computing the recommendation. + string UsageLastConsumptionDate { get; set; } + /// What the usage data values represent ex: virtual machine instance. + string UsageLookBackUnitType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsProperties.json.cs new file mode 100644 index 000000000000..a21ef6c77747 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsProperties.json.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the reservation recommendation. + public partial class ReservationRecommendationDetailsProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationRecommendationDetailsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationRecommendationDetailsProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsResourceProperties.FromJson(__jsonResource) : Resource;} + {_saving = If( json?.PropertyT("savings"), out var __jsonSavings) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsSavingsProperties.FromJson(__jsonSavings) : Saving;} + {_usage = If( json?.PropertyT("usage"), out var __jsonUsage) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsUsageProperties.FromJson(__jsonUsage) : Usage;} + {_currency = If( json?.PropertyT("currency"), out var __jsonCurrency) ? (string)__jsonCurrency : (string)Currency;} + {_resourceGroup = If( json?.PropertyT("resourceGroup"), out var __jsonResourceGroup) ? (string)__jsonResourceGroup : (string)ResourceGroup;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._resource ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._resource.ToJson(null,serializationMode) : null, "resource" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._saving ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._saving.ToJson(null,serializationMode) : null, "savings" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usage ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) this._usage.ToJson(null,serializationMode) : null, "usage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._currency.ToString()) : null, "currency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceGroup.ToString()) : null, "resourceGroup" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsResourceProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsResourceProperties.PowerShell.cs new file mode 100644 index 000000000000..9aa73fc4923a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsResourceProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Details of the resource. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationDetailsResourcePropertiesTypeConverter))] + public partial class ReservationRecommendationDetailsResourceProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationRecommendationDetailsResourceProperties(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationRecommendationDetailsResourceProperties(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationRecommendationDetailsResourceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AppliedScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).AppliedScope = (string[]) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OnDemandRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).OnDemandRate = (float?) content.GetValueForProperty("OnDemandRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).OnDemandRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Product")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).Product, global::System.Convert.ToString); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("ReservationRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).ReservationRate = (float?) content.GetValueForProperty("ReservationRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).ReservationRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).ResourceType, 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 ReservationRecommendationDetailsResourceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AppliedScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).AppliedScope = (string[]) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OnDemandRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).OnDemandRate = (float?) content.GetValueForProperty("OnDemandRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).OnDemandRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Product")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).Product, global::System.Convert.ToString); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("ReservationRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).ReservationRate = (float?) content.GetValueForProperty("ReservationRate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).ReservationRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal)this).ResourceType, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details of the resource. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationDetailsResourcePropertiesTypeConverter))] + public partial interface IReservationRecommendationDetailsResourceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsResourceProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsResourceProperties.TypeConverter.cs new file mode 100644 index 000000000000..62c9778249ea --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsResourceProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationRecommendationDetailsResourcePropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationRecommendationDetailsResourceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationRecommendationDetailsResourceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationRecommendationDetailsResourceProperties.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/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsResourceProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsResourceProperties.cs new file mode 100644 index 000000000000..68b931fb3a7e --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsResourceProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Details of the resource. + public partial class ReservationRecommendationDetailsResourceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal + { + + /// Backing field for property. + private string[] _appliedScope; + + /// List of subscriptions for which the reservation is applied. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string[] AppliedScope { get => this._appliedScope; } + + /// Internal Acessors for AppliedScope + string[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal.AppliedScope { get => this._appliedScope; set { {_appliedScope = value;} } } + + /// Internal Acessors for OnDemandRate + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal.OnDemandRate { get => this._onDemandRate; set { {_onDemandRate = value;} } } + + /// Internal Acessors for Product + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal.Product { get => this._product; set { {_product = value;} } } + + /// Internal Acessors for Region + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal.Region { get => this._region; set { {_region = value;} } } + + /// Internal Acessors for ReservationRate + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal.ReservationRate { get => this._reservationRate; set { {_reservationRate = value;} } } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourcePropertiesInternal.ResourceType { get => this._resourceType; set { {_resourceType = value;} } } + + /// Backing field for property. + private float? _onDemandRate; + + /// + /// Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? OnDemandRate { get => this._onDemandRate; } + + /// Backing field for property. + private string _product; + + /// Azure product ex: Standard_E8s_v3 etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Product { get => this._product; } + + /// Backing field for property. + private string _region; + + /// Azure resource region ex:EastUS, WestUS etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Region { get => this._region; } + + /// Backing field for property. + private float? _reservationRate; + + /// Hourly reservation rate of the resource. Varies based on the term. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? ReservationRate { get => this._reservationRate; } + + /// Backing field for property. + private string _resourceType; + + /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceType { get => this._resourceType; } + + /// + /// Creates an new instance. + /// + public ReservationRecommendationDetailsResourceProperties() + { + + } + } + /// Details of the resource. + public partial interface IReservationRecommendationDetailsResourceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// List of subscriptions for which the reservation is applied. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of subscriptions for which the reservation is applied.", + SerializedName = @"appliedScopes", + PossibleTypes = new [] { typeof(string) })] + string[] AppliedScope { get; } + /// + /// Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included.", + SerializedName = @"onDemandRate", + PossibleTypes = new [] { typeof(float) })] + float? OnDemandRate { get; } + /// Azure product ex: Standard_E8s_v3 etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure product ex: Standard_E8s_v3 etc.", + SerializedName = @"product", + PossibleTypes = new [] { typeof(string) })] + string Product { get; } + /// Azure resource region ex:EastUS, WestUS etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure resource region ex:EastUS, WestUS etc.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + string Region { get; } + /// Hourly reservation rate of the resource. Varies based on the term. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Hourly reservation rate of the resource. Varies based on the term.", + SerializedName = @"reservationRate", + PossibleTypes = new [] { typeof(float) })] + float? ReservationRate { get; } + /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The azure resource type.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; } + + } + /// Details of the resource. + internal partial interface IReservationRecommendationDetailsResourcePropertiesInternal + + { + /// List of subscriptions for which the reservation is applied. + string[] AppliedScope { get; set; } + /// + /// Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included. + /// + float? OnDemandRate { get; set; } + /// Azure product ex: Standard_E8s_v3 etc. + string Product { get; set; } + /// Azure resource region ex:EastUS, WestUS etc. + string Region { get; set; } + /// Hourly reservation rate of the resource. Varies based on the term. + float? ReservationRate { get; set; } + /// The azure resource type. + string ResourceType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsResourceProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsResourceProperties.json.cs new file mode 100644 index 000000000000..a4a3adfb0ec6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsResourceProperties.json.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Details of the resource. + public partial class ReservationRecommendationDetailsResourceProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationRecommendationDetailsResourceProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationRecommendationDetailsResourceProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_appliedScope = If( json?.PropertyT("appliedScopes"), out var __jsonAppliedScopes) ? If( __jsonAppliedScopes as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AppliedScope;} + {_onDemandRate = If( json?.PropertyT("onDemandRate"), out var __jsonOnDemandRate) ? (float?)__jsonOnDemandRate : OnDemandRate;} + {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? (string)__jsonProduct : (string)Product;} + {_region = If( json?.PropertyT("region"), out var __jsonRegion) ? (string)__jsonRegion : (string)Region;} + {_reservationRate = If( json?.PropertyT("reservationRate"), out var __jsonReservationRate) ? (float?)__jsonReservationRate : ReservationRate;} + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._appliedScope) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._appliedScope ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("appliedScopes",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._onDemandRate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._onDemandRate) : null, "onDemandRate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._product)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._product.ToString()) : null, "product" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._region)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._region.ToString()) : null, "region" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._reservationRate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._reservationRate) : null, "reservationRate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsSavingsProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsSavingsProperties.PowerShell.cs new file mode 100644 index 000000000000..fede7577e96d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsSavingsProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Details of the estimated savings. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationDetailsSavingsPropertiesTypeConverter))] + public partial class ReservationRecommendationDetailsSavingsProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationRecommendationDetailsSavingsProperties(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationRecommendationDetailsSavingsProperties(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationRecommendationDetailsSavingsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CalculatedSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).CalculatedSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[]) content.GetValueForProperty("CalculatedSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).CalculatedSaving, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsCalculatedSavingsPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).LookBackPeriod = (int?) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).LookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).RecommendedQuantity = (float?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).RecommendedQuantity, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ReservationOrderTerm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).ReservationOrderTerm = (string) content.GetValueForProperty("ReservationOrderTerm",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).ReservationOrderTerm, global::System.Convert.ToString); + } + if (content.Contains("SavingsType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).SavingsType = (string) content.GetValueForProperty("SavingsType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).SavingsType, global::System.Convert.ToString); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).UnitOfMeasure, 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 ReservationRecommendationDetailsSavingsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CalculatedSaving")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).CalculatedSaving = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[]) content.GetValueForProperty("CalculatedSaving",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).CalculatedSaving, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsCalculatedSavingsPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("LookBackPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).LookBackPeriod = (int?) content.GetValueForProperty("LookBackPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).LookBackPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RecommendedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).RecommendedQuantity = (float?) content.GetValueForProperty("RecommendedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).RecommendedQuantity, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ReservationOrderTerm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).ReservationOrderTerm = (string) content.GetValueForProperty("ReservationOrderTerm",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).ReservationOrderTerm, global::System.Convert.ToString); + } + if (content.Contains("SavingsType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).SavingsType = (string) content.GetValueForProperty("SavingsType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).SavingsType, global::System.Convert.ToString); + } + if (content.Contains("UnitOfMeasure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).UnitOfMeasure = (string) content.GetValueForProperty("UnitOfMeasure",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal)this).UnitOfMeasure, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details of the estimated savings. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationDetailsSavingsPropertiesTypeConverter))] + public partial interface IReservationRecommendationDetailsSavingsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsSavingsProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsSavingsProperties.TypeConverter.cs new file mode 100644 index 000000000000..529092f58080 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsSavingsProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationRecommendationDetailsSavingsPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationRecommendationDetailsSavingsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationRecommendationDetailsSavingsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationRecommendationDetailsSavingsProperties.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/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsSavingsProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsSavingsProperties.cs new file mode 100644 index 000000000000..a1742b9efdc4 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsSavingsProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Details of the estimated savings. + public partial class ReservationRecommendationDetailsSavingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[] _calculatedSaving; + + /// List of calculated savings. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[] CalculatedSaving { get => this._calculatedSaving; set => this._calculatedSaving = value; } + + /// Backing field for property. + private int? _lookBackPeriod; + + /// Number of days of usage to look back used for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public int? LookBackPeriod { get => this._lookBackPeriod; } + + /// Internal Acessors for LookBackPeriod + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal.LookBackPeriod { get => this._lookBackPeriod; set { {_lookBackPeriod = value;} } } + + /// Internal Acessors for RecommendedQuantity + float? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal.RecommendedQuantity { get => this._recommendedQuantity; set { {_recommendedQuantity = value;} } } + + /// Internal Acessors for ReservationOrderTerm + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal.ReservationOrderTerm { get => this._reservationOrderTerm; set { {_reservationOrderTerm = value;} } } + + /// Internal Acessors for SavingsType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal.SavingsType { get => this._savingsType; set { {_savingsType = value;} } } + + /// Internal Acessors for UnitOfMeasure + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsPropertiesInternal.UnitOfMeasure { get => this._unitOfMeasure; set { {_unitOfMeasure = value;} } } + + /// Backing field for property. + private float? _recommendedQuantity; + + /// Number of recommended units of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float? RecommendedQuantity { get => this._recommendedQuantity; } + + /// Backing field for property. + private string _reservationOrderTerm; + + /// Term period of the reservation, ex: P1Y or P3Y. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationOrderTerm { get => this._reservationOrderTerm; } + + /// Backing field for property. + private string _savingsType; + + /// Type of savings, ex: instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SavingsType { get => this._savingsType; } + + /// Backing field for property. + private string _unitOfMeasure; + + /// Measurement unit ex: hour etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string UnitOfMeasure { get => this._unitOfMeasure; } + + /// + /// Creates an new instance. + /// + public ReservationRecommendationDetailsSavingsProperties() + { + + } + } + /// Details of the estimated savings. + public partial interface IReservationRecommendationDetailsSavingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// List of calculated savings. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of calculated savings.", + SerializedName = @"calculatedSavings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[] CalculatedSaving { get; set; } + /// Number of days of usage to look back used for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of days of usage to look back used for computing the recommendation.", + SerializedName = @"lookBackPeriod", + PossibleTypes = new [] { typeof(int) })] + int? LookBackPeriod { get; } + /// Number of recommended units of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of recommended units of the resource.", + SerializedName = @"recommendedQuantity", + PossibleTypes = new [] { typeof(float) })] + float? RecommendedQuantity { get; } + /// Term period of the reservation, ex: P1Y or P3Y. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Term period of the reservation, ex: P1Y or P3Y.", + SerializedName = @"reservationOrderTerm", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderTerm { get; } + /// Type of savings, ex: instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of savings, ex: instance.", + SerializedName = @"savingsType", + PossibleTypes = new [] { typeof(string) })] + string SavingsType { get; } + /// Measurement unit ex: hour etc. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Measurement unit ex: hour etc.", + SerializedName = @"unitOfMeasure", + PossibleTypes = new [] { typeof(string) })] + string UnitOfMeasure { get; } + + } + /// Details of the estimated savings. + internal partial interface IReservationRecommendationDetailsSavingsPropertiesInternal + + { + /// List of calculated savings. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties[] CalculatedSaving { get; set; } + /// Number of days of usage to look back used for computing the recommendation. + int? LookBackPeriod { get; set; } + /// Number of recommended units of the resource. + float? RecommendedQuantity { get; set; } + /// Term period of the reservation, ex: P1Y or P3Y. + string ReservationOrderTerm { get; set; } + /// Type of savings, ex: instance. + string SavingsType { get; set; } + /// Measurement unit ex: hour etc. + string UnitOfMeasure { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsSavingsProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsSavingsProperties.json.cs new file mode 100644 index 000000000000..51649232e9ff --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsSavingsProperties.json.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Details of the estimated savings. + public partial class ReservationRecommendationDetailsSavingsProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsSavingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationRecommendationDetailsSavingsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationRecommendationDetailsSavingsProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_calculatedSaving = If( json?.PropertyT("calculatedSavings"), out var __jsonCalculatedSavings) ? If( __jsonCalculatedSavings as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationRecommendationDetailsCalculatedSavingsProperties) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationDetailsCalculatedSavingsProperties.FromJson(__u) )) ))() : null : CalculatedSaving;} + {_lookBackPeriod = If( json?.PropertyT("lookBackPeriod"), out var __jsonLookBackPeriod) ? (int?)__jsonLookBackPeriod : LookBackPeriod;} + {_recommendedQuantity = If( json?.PropertyT("recommendedQuantity"), out var __jsonRecommendedQuantity) ? (float?)__jsonRecommendedQuantity : RecommendedQuantity;} + {_reservationOrderTerm = If( json?.PropertyT("reservationOrderTerm"), out var __jsonReservationOrderTerm) ? (string)__jsonReservationOrderTerm : (string)ReservationOrderTerm;} + {_savingsType = If( json?.PropertyT("savingsType"), out var __jsonSavingsType) ? (string)__jsonSavingsType : (string)SavingsType;} + {_unitOfMeasure = If( json?.PropertyT("unitOfMeasure"), out var __jsonUnitOfMeasure) ? (string)__jsonUnitOfMeasure : (string)UnitOfMeasure;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._calculatedSaving) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._calculatedSaving ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("calculatedSavings",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lookBackPeriod ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((int)this._lookBackPeriod) : null, "lookBackPeriod" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._recommendedQuantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((float)this._recommendedQuantity) : null, "recommendedQuantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationOrderTerm)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationOrderTerm.ToString()) : null, "reservationOrderTerm" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._savingsType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._savingsType.ToString()) : null, "savingsType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._unitOfMeasure)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._unitOfMeasure.ToString()) : null, "unitOfMeasure" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsUsageProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsUsageProperties.PowerShell.cs new file mode 100644 index 000000000000..7392a6b9408f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsUsageProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// Details about historical usage data that has been used for computing the recommendation. + /// + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationDetailsUsagePropertiesTypeConverter))] + public partial class ReservationRecommendationDetailsUsageProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationRecommendationDetailsUsageProperties(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationRecommendationDetailsUsageProperties(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.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationRecommendationDetailsUsageProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FirstConsumptionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).FirstConsumptionDate = (string) content.GetValueForProperty("FirstConsumptionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).FirstConsumptionDate, global::System.Convert.ToString); + } + if (content.Contains("LastConsumptionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).LastConsumptionDate = (string) content.GetValueForProperty("LastConsumptionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).LastConsumptionDate, global::System.Convert.ToString); + } + if (content.Contains("LookBackUnitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).LookBackUnitType = (string) content.GetValueForProperty("LookBackUnitType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).LookBackUnitType, global::System.Convert.ToString); + } + if (content.Contains("UsageData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).UsageData = (float[]) content.GetValueForProperty("UsageData",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).UsageData, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (float) global::System.Convert.ChangeType(__w, typeof(float)))); + } + if (content.Contains("UsageGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).UsageGrain = (string) content.GetValueForProperty("UsageGrain",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).UsageGrain, 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 ReservationRecommendationDetailsUsageProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FirstConsumptionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).FirstConsumptionDate = (string) content.GetValueForProperty("FirstConsumptionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).FirstConsumptionDate, global::System.Convert.ToString); + } + if (content.Contains("LastConsumptionDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).LastConsumptionDate = (string) content.GetValueForProperty("LastConsumptionDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).LastConsumptionDate, global::System.Convert.ToString); + } + if (content.Contains("LookBackUnitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).LookBackUnitType = (string) content.GetValueForProperty("LookBackUnitType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).LookBackUnitType, global::System.Convert.ToString); + } + if (content.Contains("UsageData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).UsageData = (float[]) content.GetValueForProperty("UsageData",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).UsageData, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (float) global::System.Convert.ChangeType(__w, typeof(float)))); + } + if (content.Contains("UsageGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).UsageGrain = (string) content.GetValueForProperty("UsageGrain",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal)this).UsageGrain, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details about historical usage data that has been used for computing the recommendation. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationDetailsUsagePropertiesTypeConverter))] + public partial interface IReservationRecommendationDetailsUsageProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsUsageProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsUsageProperties.TypeConverter.cs new file mode 100644 index 000000000000..861f8113898a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsUsageProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationRecommendationDetailsUsagePropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationRecommendationDetailsUsageProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationRecommendationDetailsUsageProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationRecommendationDetailsUsageProperties.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/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsUsageProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsUsageProperties.cs new file mode 100644 index 000000000000..3bf6dd770f7e --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsUsageProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Details about historical usage data that has been used for computing the recommendation. + /// + public partial class ReservationRecommendationDetailsUsageProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal + { + + /// Backing field for property. + private string _firstConsumptionDate; + + /// The first usage date used for looking back for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string FirstConsumptionDate { get => this._firstConsumptionDate; } + + /// Backing field for property. + private string _lastConsumptionDate; + + /// The last usage date used for looking back for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string LastConsumptionDate { get => this._lastConsumptionDate; } + + /// Backing field for property. + private string _lookBackUnitType; + + /// What the usage data values represent ex: virtual machine instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string LookBackUnitType { get => this._lookBackUnitType; } + + /// Internal Acessors for FirstConsumptionDate + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal.FirstConsumptionDate { get => this._firstConsumptionDate; set { {_firstConsumptionDate = value;} } } + + /// Internal Acessors for LastConsumptionDate + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal.LastConsumptionDate { get => this._lastConsumptionDate; set { {_lastConsumptionDate = value;} } } + + /// Internal Acessors for LookBackUnitType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal.LookBackUnitType { get => this._lookBackUnitType; set { {_lookBackUnitType = value;} } } + + /// Internal Acessors for UsageData + float[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal.UsageData { get => this._usageData; set { {_usageData = value;} } } + + /// Internal Acessors for UsageGrain + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsagePropertiesInternal.UsageGrain { get => this._usageGrain; set { {_usageGrain = value;} } } + + /// Backing field for property. + private float[] _usageData; + + /// + /// The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and + /// the lastConsumptionDate. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public float[] UsageData { get => this._usageData; } + + /// Backing field for property. + private string _usageGrain; + + /// The grain of the values represented in the usage data ex: hourly. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string UsageGrain { get => this._usageGrain; } + + /// + /// Creates an new instance. + /// + public ReservationRecommendationDetailsUsageProperties() + { + + } + } + /// Details about historical usage data that has been used for computing the recommendation. + public partial interface IReservationRecommendationDetailsUsageProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The first usage date used for looking back for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The first usage date used for looking back for computing the recommendation.", + SerializedName = @"firstConsumptionDate", + PossibleTypes = new [] { typeof(string) })] + string FirstConsumptionDate { get; } + /// The last usage date used for looking back for computing the recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The last usage date used for looking back for computing the recommendation.", + SerializedName = @"lastConsumptionDate", + PossibleTypes = new [] { typeof(string) })] + string LastConsumptionDate { get; } + /// What the usage data values represent ex: virtual machine instance. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"What the usage data values represent ex: virtual machine instance.", + SerializedName = @"lookBackUnitType", + PossibleTypes = new [] { typeof(string) })] + string LookBackUnitType { get; } + /// + /// The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and + /// the lastConsumptionDate. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and the lastConsumptionDate.", + SerializedName = @"usageData", + PossibleTypes = new [] { typeof(float) })] + float[] UsageData { get; } + /// The grain of the values represented in the usage data ex: hourly. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The grain of the values represented in the usage data ex: hourly.", + SerializedName = @"usageGrain", + PossibleTypes = new [] { typeof(string) })] + string UsageGrain { get; } + + } + /// Details about historical usage data that has been used for computing the recommendation. + internal partial interface IReservationRecommendationDetailsUsagePropertiesInternal + + { + /// The first usage date used for looking back for computing the recommendation. + string FirstConsumptionDate { get; set; } + /// The last usage date used for looking back for computing the recommendation. + string LastConsumptionDate { get; set; } + /// What the usage data values represent ex: virtual machine instance. + string LookBackUnitType { get; set; } + /// + /// The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate and + /// the lastConsumptionDate. + /// + float[] UsageData { get; set; } + /// The grain of the values represented in the usage data ex: hourly. + string UsageGrain { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsUsageProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsUsageProperties.json.cs new file mode 100644 index 000000000000..c90971427c59 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationDetailsUsageProperties.json.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Details about historical usage data that has been used for computing the recommendation. + /// + public partial class ReservationRecommendationDetailsUsageProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsUsageProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationRecommendationDetailsUsageProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationRecommendationDetailsUsageProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_firstConsumptionDate = If( json?.PropertyT("firstConsumptionDate"), out var __jsonFirstConsumptionDate) ? (string)__jsonFirstConsumptionDate : (string)FirstConsumptionDate;} + {_lastConsumptionDate = If( json?.PropertyT("lastConsumptionDate"), out var __jsonLastConsumptionDate) ? (string)__jsonLastConsumptionDate : (string)LastConsumptionDate;} + {_lookBackUnitType = If( json?.PropertyT("lookBackUnitType"), out var __jsonLookBackUnitType) ? (string)__jsonLookBackUnitType : (string)LookBackUnitType;} + {_usageData = If( json?.PropertyT("usageData"), out var __jsonUsageData) ? If( __jsonUsageData as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(float) (__u is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber __t ? (float)__t : default(float))) ))() : null : UsageData;} + {_usageGrain = If( json?.PropertyT("usageGrain"), out var __jsonUsageGrain) ? (string)__jsonUsageGrain : (string)UsageGrain;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._firstConsumptionDate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._firstConsumptionDate.ToString()) : null, "firstConsumptionDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lastConsumptionDate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._lastConsumptionDate.ToString()) : null, "lastConsumptionDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lookBackUnitType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._lookBackUnitType.ToString()) : null, "lookBackUnitType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._usageData) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._usageData ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber(__x) ,__w.Add); + } + container.Add("usageData",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._usageGrain)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._usageGrain.ToString()) : null, "usageGrain" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationsListResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationsListResult.PowerShell.cs new file mode 100644 index 000000000000..7dd0e8ba3127 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationsListResult.PowerShell.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Result of listing reservation recommendations. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationsListResultTypeConverter))] + public partial class ReservationRecommendationsListResult + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationRecommendationsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationRecommendationsListResult(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.Consumption.Models.Api20211001.IReservationRecommendationsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationRecommendationsListResult(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.Consumption.Models.Api20211001.IReservationRecommendationsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationRecommendationsListResult(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.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("PreviousLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal)this).PreviousLink = (string) content.GetValueForProperty("PreviousLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal)this).PreviousLink, 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 ReservationRecommendationsListResult(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.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("PreviousLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal)this).PreviousLink = (string) content.GetValueForProperty("PreviousLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal)this).PreviousLink, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing reservation recommendations. + [System.ComponentModel.TypeConverter(typeof(ReservationRecommendationsListResultTypeConverter))] + public partial interface IReservationRecommendationsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationsListResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationsListResult.TypeConverter.cs new file mode 100644 index 000000000000..fd2ebfa5abf2 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationsListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationRecommendationsListResultTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationRecommendationsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationRecommendationsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationRecommendationsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationRecommendationsListResult.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/consumption/generated/api/Models/Api20211001/ReservationRecommendationsListResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationsListResult.cs new file mode 100644 index 000000000000..1e812912c520 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationsListResult.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing reservation recommendations. + public partial class ReservationRecommendationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for PreviousLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal.PreviousLink { get => this._previousLink; set { {_previousLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResultInternal.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private string _previousLink; + + /// The link (url) to the previous page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PreviousLink { get => this._previousLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation[] _value; + + /// The list of reservation recommendations. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation[] Value { get => this._value; } + + /// Creates an new instance. + public ReservationRecommendationsListResult() + { + + } + } + /// Result of listing reservation recommendations. + public partial interface IReservationRecommendationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 link (url) to the previous page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The link (url) to the previous page of results.", + SerializedName = @"previousLink", + PossibleTypes = new [] { typeof(string) })] + string PreviousLink { get; } + /// The list of reservation recommendations. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of reservation recommendations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation[] Value { get; } + + } + /// Result of listing reservation recommendations. + internal partial interface IReservationRecommendationsListResultInternal + + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The link (url) to the previous page of results. + string PreviousLink { get; set; } + /// The list of reservation recommendations. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationsListResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationsListResult.json.cs new file mode 100644 index 000000000000..78bfa7f261ab --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationRecommendationsListResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing reservation recommendations. + public partial class ReservationRecommendationsListResult + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationRecommendationsListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationRecommendationsListResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IReservationRecommendation) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationRecommendation.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_previousLink = If( json?.PropertyT("previousLink"), out var __jsonPreviousLink) ? (string)__jsonPreviousLink : (string)PreviousLink;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._previousLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._previousLink.ToString()) : null, "previousLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummariesListResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummariesListResult.PowerShell.cs new file mode 100644 index 000000000000..7f350cd34d29 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummariesListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Result of listing reservation summaries. + [System.ComponentModel.TypeConverter(typeof(ReservationSummariesListResultTypeConverter))] + public partial class ReservationSummariesListResult + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationSummariesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationSummariesListResult(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.Consumption.Models.Api20211001.IReservationSummariesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationSummariesListResult(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.Consumption.Models.Api20211001.IReservationSummariesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationSummariesListResult(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.Consumption.Models.Api20211001.IReservationSummariesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummaryTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResultInternal)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 ReservationSummariesListResult(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.Consumption.Models.Api20211001.IReservationSummariesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummaryTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResultInternal)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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing reservation summaries. + [System.ComponentModel.TypeConverter(typeof(ReservationSummariesListResultTypeConverter))] + public partial interface IReservationSummariesListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummariesListResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummariesListResult.TypeConverter.cs new file mode 100644 index 000000000000..b98b0d59c29d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummariesListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationSummariesListResultTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationSummariesListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationSummariesListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationSummariesListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationSummariesListResult.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/consumption/generated/api/Models/Api20211001/ReservationSummariesListResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummariesListResult.cs new file mode 100644 index 000000000000..cf5d6200aee0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummariesListResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing reservation summaries. + public partial class ReservationSummariesListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResultInternal.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary[] _value; + + /// The list of reservation summaries. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary[] Value { get => this._value; } + + /// Creates an new instance. + public ReservationSummariesListResult() + { + + } + } + /// Result of listing reservation summaries. + public partial interface IReservationSummariesListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 reservation summaries. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of reservation summaries.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary[] Value { get; } + + } + /// Result of listing reservation summaries. + internal partial interface IReservationSummariesListResultInternal + + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The list of reservation summaries. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummariesListResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummariesListResult.json.cs new file mode 100644 index 000000000000..8016205ceb3d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummariesListResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing reservation summaries. + public partial class ReservationSummariesListResult + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummariesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationSummariesListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationSummariesListResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IReservationSummary) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummary.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ReservationSummary.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummary.PowerShell.cs new file mode 100644 index 000000000000..24e3ab6a722c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummary.PowerShell.cs @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// reservation summary resource. + [System.ComponentModel.TypeConverter(typeof(ReservationSummaryTypeConverter))] + public partial class ReservationSummary + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationSummary DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationSummary(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.Consumption.Models.Api20211001.IReservationSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationSummary(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.Consumption.Models.Api20211001.IReservationSummary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationSummary(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.Consumption.Models.Api20211001.IReservationSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummaryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("ReservedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).ReservedHour = (decimal?) content.GetValueForProperty("ReservedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).ReservedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UsageDate = (global::System.DateTime?) content.GetValueForProperty("UsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UsedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UsedHour = (decimal?) content.GetValueForProperty("UsedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UsedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MinUtilizationPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).MinUtilizationPercentage = (decimal?) content.GetValueForProperty("MinUtilizationPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).MinUtilizationPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AvgUtilizationPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).AvgUtilizationPercentage = (decimal?) content.GetValueForProperty("AvgUtilizationPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).AvgUtilizationPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MaxUtilizationPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).MaxUtilizationPercentage = (decimal?) content.GetValueForProperty("MaxUtilizationPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).MaxUtilizationPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("PurchasedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).PurchasedQuantity = (decimal?) content.GetValueForProperty("PurchasedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).PurchasedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("RemainingQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).RemainingQuantity = (decimal?) content.GetValueForProperty("RemainingQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).RemainingQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalReservedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).TotalReservedQuantity = (decimal?) content.GetValueForProperty("TotalReservedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).TotalReservedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UsedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UsedQuantity = (decimal?) content.GetValueForProperty("UsedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UsedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UtilizedPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UtilizedPercentage = (decimal?) content.GetValueForProperty("UtilizedPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UtilizedPercentage, (__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 ReservationSummary(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.Consumption.Models.Api20211001.IReservationSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummaryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("ReservedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).ReservedHour = (decimal?) content.GetValueForProperty("ReservedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).ReservedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UsageDate = (global::System.DateTime?) content.GetValueForProperty("UsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UsedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UsedHour = (decimal?) content.GetValueForProperty("UsedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UsedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MinUtilizationPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).MinUtilizationPercentage = (decimal?) content.GetValueForProperty("MinUtilizationPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).MinUtilizationPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AvgUtilizationPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).AvgUtilizationPercentage = (decimal?) content.GetValueForProperty("AvgUtilizationPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).AvgUtilizationPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MaxUtilizationPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).MaxUtilizationPercentage = (decimal?) content.GetValueForProperty("MaxUtilizationPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).MaxUtilizationPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("PurchasedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).PurchasedQuantity = (decimal?) content.GetValueForProperty("PurchasedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).PurchasedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("RemainingQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).RemainingQuantity = (decimal?) content.GetValueForProperty("RemainingQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).RemainingQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalReservedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).TotalReservedQuantity = (decimal?) content.GetValueForProperty("TotalReservedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).TotalReservedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UsedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UsedQuantity = (decimal?) content.GetValueForProperty("UsedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UsedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UtilizedPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UtilizedPercentage = (decimal?) content.GetValueForProperty("UtilizedPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal)this).UtilizedPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// reservation summary resource. + [System.ComponentModel.TypeConverter(typeof(ReservationSummaryTypeConverter))] + public partial interface IReservationSummary + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummary.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummary.TypeConverter.cs new file mode 100644 index 000000000000..e1618405a871 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummary.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationSummaryTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationSummary ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationSummary.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationSummary.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationSummary.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/consumption/generated/api/Models/Api20211001/ReservationSummary.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummary.cs new file mode 100644 index 000000000000..3e2655dee37a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummary.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// reservation summary resource. + public partial class ReservationSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(); + + /// + /// This is average utilization for the entire time range. (day or month depending on the grain) + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? AvgUtilizationPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).AvgUtilizationPercentage; } + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// The reservation kind. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).Kind; } + + /// + /// This is the maximum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 + /// and on that for hour 4 and 5, utilization was 100%, this field will return 100% for that day. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? MaxUtilizationPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).MaxUtilizationPercentage; } + + /// Internal Acessors for AvgUtilizationPercentage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.AvgUtilizationPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).AvgUtilizationPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).AvgUtilizationPercentage = value; } + + /// Internal Acessors for Kind + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).Kind = value; } + + /// Internal Acessors for MaxUtilizationPercentage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.MaxUtilizationPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).MaxUtilizationPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).MaxUtilizationPercentage = value; } + + /// Internal Acessors for MinUtilizationPercentage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.MinUtilizationPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).MinUtilizationPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).MinUtilizationPercentage = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummaryProperties()); set { {_property = value;} } } + + /// Internal Acessors for PurchasedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.PurchasedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).PurchasedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).PurchasedQuantity = value; } + + /// Internal Acessors for RemainingQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.RemainingQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).RemainingQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).RemainingQuantity = value; } + + /// Internal Acessors for ReservationId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.ReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).ReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).ReservationId = value; } + + /// Internal Acessors for ReservationOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).ReservationOrderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).ReservationOrderId = value; } + + /// Internal Acessors for ReservedHour + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.ReservedHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).ReservedHour; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).ReservedHour = value; } + + /// Internal Acessors for SkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).SkuName = value; } + + /// Internal Acessors for TotalReservedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.TotalReservedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).TotalReservedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).TotalReservedQuantity = value; } + + /// Internal Acessors for UsageDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.UsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).UsageDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).UsageDate = value; } + + /// Internal Acessors for UsedHour + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.UsedHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).UsedHour; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).UsedHour = value; } + + /// Internal Acessors for UsedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.UsedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).UsedQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).UsedQuantity = value; } + + /// Internal Acessors for UtilizedPercentage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryInternal.UtilizedPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).UtilizedPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).UtilizedPercentage = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// + /// This is the minimum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 + /// and on that for hour 4 and 5, utilization was 10%, this field will return 10% for that day + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? MinUtilizationPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).MinUtilizationPercentage; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryProperties _property; + + /// The properties of the reservation summary. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummaryProperties()); set => this._property = value; } + + /// This is the purchased quantity for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? PurchasedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).PurchasedQuantity; } + + /// This is the remaining quantity for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? RemainingQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).RemainingQuantity; } + + /// + /// The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for + /// applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied + /// to. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).ReservationId; } + + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).ReservationOrderId; } + + /// + /// This is the total hours reserved. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours for that + /// day and 24 hours from subsequent days + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? ReservedHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).ReservedHour; } + + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).SkuName; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// This is the total count of instances that are reserved for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? TotalReservedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).TotalReservedQuantity; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// + /// Data corresponding to the utilization record. If the grain of data is monthly, it will be first day of month. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? UsageDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).UsageDate; } + + /// Total used hours by the reservation + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? UsedHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).UsedHour; } + + /// This is the used quantity for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? UsedQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).UsedQuantity; } + + /// This is the utilized percentage for the reservation Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? UtilizedPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)Property).UtilizedPercentage; } + + /// Creates an new instance. + public ReservationSummary() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// reservation summary resource. + public partial interface IReservationSummary : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource + { + /// + /// This is average utilization for the entire time range. (day or month depending on the grain) + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is average utilization for the entire time range. (day or month depending on the grain)", + SerializedName = @"avgUtilizationPercentage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AvgUtilizationPercentage { get; } + /// The reservation kind. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation kind.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + string Kind { get; } + /// + /// This is the maximum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 + /// and on that for hour 4 and 5, utilization was 100%, this field will return 100% for that day. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the maximum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 100%, this field will return 100% for that day.", + SerializedName = @"maxUtilizationPercentage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MaxUtilizationPercentage { get; } + /// + /// This is the minimum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 + /// and on that for hour 4 and 5, utilization was 10%, this field will return 10% for that day + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the minimum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 10%, this field will return 10% for that day", + SerializedName = @"minUtilizationPercentage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MinUtilizationPercentage { get; } + /// This is the purchased quantity for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the purchased quantity for the reservationId.", + SerializedName = @"purchasedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PurchasedQuantity { get; } + /// This is the remaining quantity for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the remaining quantity for the reservationId.", + SerializedName = @"remainingQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? RemainingQuantity { get; } + /// + /// The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for + /// applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied + /// to. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied to.", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + string ReservationId { get; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations.", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderId { get; } + /// + /// This is the total hours reserved. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours for that + /// day and 24 hours from subsequent days + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the total hours reserved. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent days", + SerializedName = @"reservedHours", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ReservedHour { get; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records.", + SerializedName = @"skuName", + PossibleTypes = new [] { typeof(string) })] + string SkuName { get; } + /// This is the total count of instances that are reserved for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the total count of instances that are reserved for the reservationId.", + SerializedName = @"totalReservedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalReservedQuantity { get; } + /// + /// Data corresponding to the utilization record. If the grain of data is monthly, it will be first day of month. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Data corresponding to the utilization record. If the grain of data is monthly, it will be first day of month.", + SerializedName = @"usageDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageDate { get; } + /// Total used hours by the reservation + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total used hours by the reservation", + SerializedName = @"usedHours", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UsedHour { get; } + /// This is the used quantity for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the used quantity for the reservationId.", + SerializedName = @"usedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UsedQuantity { get; } + /// This is the utilized percentage for the reservation Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the utilized percentage for the reservation Id.", + SerializedName = @"utilizedPercentage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UtilizedPercentage { get; } + + } + /// reservation summary resource. + internal partial interface IReservationSummaryInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal + { + /// + /// This is average utilization for the entire time range. (day or month depending on the grain) + /// + decimal? AvgUtilizationPercentage { get; set; } + /// The reservation kind. + string Kind { get; set; } + /// + /// This is the maximum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 + /// and on that for hour 4 and 5, utilization was 100%, this field will return 100% for that day. + /// + decimal? MaxUtilizationPercentage { get; set; } + /// + /// This is the minimum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 + /// and on that for hour 4 and 5, utilization was 10%, this field will return 10% for that day + /// + decimal? MinUtilizationPercentage { get; set; } + /// The properties of the reservation summary. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryProperties Property { get; set; } + /// This is the purchased quantity for the reservationId. + decimal? PurchasedQuantity { get; set; } + /// This is the remaining quantity for the reservationId. + decimal? RemainingQuantity { get; set; } + /// + /// The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for + /// applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied + /// to. + /// + string ReservationId { get; set; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + string ReservationOrderId { get; set; } + /// + /// This is the total hours reserved. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours for that + /// day and 24 hours from subsequent days + /// + decimal? ReservedHour { get; set; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + string SkuName { get; set; } + /// This is the total count of instances that are reserved for the reservationId. + decimal? TotalReservedQuantity { get; set; } + /// + /// Data corresponding to the utilization record. If the grain of data is monthly, it will be first day of month. + /// + global::System.DateTime? UsageDate { get; set; } + /// Total used hours by the reservation + decimal? UsedHour { get; set; } + /// This is the used quantity for the reservationId. + decimal? UsedQuantity { get; set; } + /// This is the utilized percentage for the reservation Id. + decimal? UtilizedPercentage { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummary.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummary.json.cs new file mode 100644 index 000000000000..0e00623594d2 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummary.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// reservation summary resource. + public partial class ReservationSummary + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationSummary(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationSummary(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationSummaryProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/ReservationSummaryProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummaryProperties.PowerShell.cs new file mode 100644 index 000000000000..fc99f83519a5 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummaryProperties.PowerShell.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the reservation summary. + [System.ComponentModel.TypeConverter(typeof(ReservationSummaryPropertiesTypeConverter))] + public partial class ReservationSummaryProperties + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationSummaryProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationSummaryProperties(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.Consumption.Models.Api20211001.IReservationSummaryProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationSummaryProperties(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.Consumption.Models.Api20211001.IReservationSummaryProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationSummaryProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("ReservedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).ReservedHour = (decimal?) content.GetValueForProperty("ReservedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).ReservedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UsageDate = (global::System.DateTime?) content.GetValueForProperty("UsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UsedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UsedHour = (decimal?) content.GetValueForProperty("UsedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UsedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MinUtilizationPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).MinUtilizationPercentage = (decimal?) content.GetValueForProperty("MinUtilizationPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).MinUtilizationPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AvgUtilizationPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).AvgUtilizationPercentage = (decimal?) content.GetValueForProperty("AvgUtilizationPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).AvgUtilizationPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MaxUtilizationPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).MaxUtilizationPercentage = (decimal?) content.GetValueForProperty("MaxUtilizationPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).MaxUtilizationPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("PurchasedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).PurchasedQuantity = (decimal?) content.GetValueForProperty("PurchasedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).PurchasedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("RemainingQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).RemainingQuantity = (decimal?) content.GetValueForProperty("RemainingQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).RemainingQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalReservedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).TotalReservedQuantity = (decimal?) content.GetValueForProperty("TotalReservedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).TotalReservedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UsedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UsedQuantity = (decimal?) content.GetValueForProperty("UsedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UsedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UtilizedPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UtilizedPercentage = (decimal?) content.GetValueForProperty("UtilizedPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UtilizedPercentage, (__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 ReservationSummaryProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("ReservedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).ReservedHour = (decimal?) content.GetValueForProperty("ReservedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).ReservedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UsageDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UsageDate = (global::System.DateTime?) content.GetValueForProperty("UsageDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UsageDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UsedHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UsedHour = (decimal?) content.GetValueForProperty("UsedHour",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UsedHour, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MinUtilizationPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).MinUtilizationPercentage = (decimal?) content.GetValueForProperty("MinUtilizationPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).MinUtilizationPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("AvgUtilizationPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).AvgUtilizationPercentage = (decimal?) content.GetValueForProperty("AvgUtilizationPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).AvgUtilizationPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("MaxUtilizationPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).MaxUtilizationPercentage = (decimal?) content.GetValueForProperty("MaxUtilizationPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).MaxUtilizationPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("PurchasedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).PurchasedQuantity = (decimal?) content.GetValueForProperty("PurchasedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).PurchasedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("RemainingQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).RemainingQuantity = (decimal?) content.GetValueForProperty("RemainingQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).RemainingQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("TotalReservedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).TotalReservedQuantity = (decimal?) content.GetValueForProperty("TotalReservedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).TotalReservedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UsedQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UsedQuantity = (decimal?) content.GetValueForProperty("UsedQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UsedQuantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("UtilizedPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UtilizedPercentage = (decimal?) content.GetValueForProperty("UtilizedPercentage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal)this).UtilizedPercentage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the reservation summary. + [System.ComponentModel.TypeConverter(typeof(ReservationSummaryPropertiesTypeConverter))] + public partial interface IReservationSummaryProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummaryProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummaryProperties.TypeConverter.cs new file mode 100644 index 000000000000..2df78ce95083 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummaryProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationSummaryPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationSummaryProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationSummaryProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationSummaryProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationSummaryProperties.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/consumption/generated/api/Models/Api20211001/ReservationSummaryProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummaryProperties.cs new file mode 100644 index 000000000000..4bc8af65a92c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummaryProperties.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the reservation summary. + public partial class ReservationSummaryProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal + { + + /// Backing field for property. + private decimal? _avgUtilizationPercentage; + + /// + /// This is average utilization for the entire time range. (day or month depending on the grain) + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? AvgUtilizationPercentage { get => this._avgUtilizationPercentage; } + + /// Backing field for property. + private string _kind; + + /// The reservation kind. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Kind { get => this._kind; } + + /// Backing field for property. + private decimal? _maxUtilizationPercentage; + + /// + /// This is the maximum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 + /// and on that for hour 4 and 5, utilization was 100%, this field will return 100% for that day. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? MaxUtilizationPercentage { get => this._maxUtilizationPercentage; } + + /// Internal Acessors for AvgUtilizationPercentage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.AvgUtilizationPercentage { get => this._avgUtilizationPercentage; set { {_avgUtilizationPercentage = value;} } } + + /// Internal Acessors for Kind + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.Kind { get => this._kind; set { {_kind = value;} } } + + /// Internal Acessors for MaxUtilizationPercentage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.MaxUtilizationPercentage { get => this._maxUtilizationPercentage; set { {_maxUtilizationPercentage = value;} } } + + /// Internal Acessors for MinUtilizationPercentage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.MinUtilizationPercentage { get => this._minUtilizationPercentage; set { {_minUtilizationPercentage = value;} } } + + /// Internal Acessors for PurchasedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.PurchasedQuantity { get => this._purchasedQuantity; set { {_purchasedQuantity = value;} } } + + /// Internal Acessors for RemainingQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.RemainingQuantity { get => this._remainingQuantity; set { {_remainingQuantity = value;} } } + + /// Internal Acessors for ReservationId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.ReservationId { get => this._reservationId; set { {_reservationId = value;} } } + + /// Internal Acessors for ReservationOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.ReservationOrderId { get => this._reservationOrderId; set { {_reservationOrderId = value;} } } + + /// Internal Acessors for ReservedHour + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.ReservedHour { get => this._reservedHour; set { {_reservedHour = value;} } } + + /// Internal Acessors for SkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.SkuName { get => this._skuName; set { {_skuName = value;} } } + + /// Internal Acessors for TotalReservedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.TotalReservedQuantity { get => this._totalReservedQuantity; set { {_totalReservedQuantity = value;} } } + + /// Internal Acessors for UsageDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.UsageDate { get => this._usageDate; set { {_usageDate = value;} } } + + /// Internal Acessors for UsedHour + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.UsedHour { get => this._usedHour; set { {_usedHour = value;} } } + + /// Internal Acessors for UsedQuantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.UsedQuantity { get => this._usedQuantity; set { {_usedQuantity = value;} } } + + /// Internal Acessors for UtilizedPercentage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryPropertiesInternal.UtilizedPercentage { get => this._utilizedPercentage; set { {_utilizedPercentage = value;} } } + + /// Backing field for property. + private decimal? _minUtilizationPercentage; + + /// + /// This is the minimum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 + /// and on that for hour 4 and 5, utilization was 10%, this field will return 10% for that day + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? MinUtilizationPercentage { get => this._minUtilizationPercentage; } + + /// Backing field for property. + private decimal? _purchasedQuantity; + + /// This is the purchased quantity for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? PurchasedQuantity { get => this._purchasedQuantity; } + + /// Backing field for property. + private decimal? _remainingQuantity; + + /// This is the remaining quantity for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? RemainingQuantity { get => this._remainingQuantity; } + + /// Backing field for property. + private string _reservationId; + + /// + /// The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for + /// applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied + /// to. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationId { get => this._reservationId; } + + /// Backing field for property. + private string _reservationOrderId; + + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationOrderId { get => this._reservationOrderId; } + + /// Backing field for property. + private decimal? _reservedHour; + + /// + /// This is the total hours reserved. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours for that + /// day and 24 hours from subsequent days + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? ReservedHour { get => this._reservedHour; } + + /// Backing field for property. + private string _skuName; + + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SkuName { get => this._skuName; } + + /// Backing field for property. + private decimal? _totalReservedQuantity; + + /// This is the total count of instances that are reserved for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? TotalReservedQuantity { get => this._totalReservedQuantity; } + + /// Backing field for property. + private global::System.DateTime? _usageDate; + + /// + /// Data corresponding to the utilization record. If the grain of data is monthly, it will be first day of month. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public global::System.DateTime? UsageDate { get => this._usageDate; } + + /// Backing field for property. + private decimal? _usedHour; + + /// Total used hours by the reservation + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? UsedHour { get => this._usedHour; } + + /// Backing field for property. + private decimal? _usedQuantity; + + /// This is the used quantity for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? UsedQuantity { get => this._usedQuantity; } + + /// Backing field for property. + private decimal? _utilizedPercentage; + + /// This is the utilized percentage for the reservation Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public decimal? UtilizedPercentage { get => this._utilizedPercentage; } + + /// Creates an new instance. + public ReservationSummaryProperties() + { + + } + } + /// The properties of the reservation summary. + public partial interface IReservationSummaryProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// + /// This is average utilization for the entire time range. (day or month depending on the grain) + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is average utilization for the entire time range. (day or month depending on the grain)", + SerializedName = @"avgUtilizationPercentage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? AvgUtilizationPercentage { get; } + /// The reservation kind. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation kind.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + string Kind { get; } + /// + /// This is the maximum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 + /// and on that for hour 4 and 5, utilization was 100%, this field will return 100% for that day. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the maximum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 100%, this field will return 100% for that day.", + SerializedName = @"maxUtilizationPercentage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MaxUtilizationPercentage { get; } + /// + /// This is the minimum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 + /// and on that for hour 4 and 5, utilization was 10%, this field will return 10% for that day + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the minimum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 10%, this field will return 10% for that day", + SerializedName = @"minUtilizationPercentage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MinUtilizationPercentage { get; } + /// This is the purchased quantity for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the purchased quantity for the reservationId.", + SerializedName = @"purchasedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? PurchasedQuantity { get; } + /// This is the remaining quantity for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the remaining quantity for the reservationId.", + SerializedName = @"remainingQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? RemainingQuantity { get; } + /// + /// The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for + /// applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied + /// to. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied to.", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + string ReservationId { get; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations.", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderId { get; } + /// + /// This is the total hours reserved. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours for that + /// day and 24 hours from subsequent days + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the total hours reserved. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent days", + SerializedName = @"reservedHours", + PossibleTypes = new [] { typeof(decimal) })] + decimal? ReservedHour { get; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records.", + SerializedName = @"skuName", + PossibleTypes = new [] { typeof(string) })] + string SkuName { get; } + /// This is the total count of instances that are reserved for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the total count of instances that are reserved for the reservationId.", + SerializedName = @"totalReservedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? TotalReservedQuantity { get; } + /// + /// Data corresponding to the utilization record. If the grain of data is monthly, it will be first day of month. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Data corresponding to the utilization record. If the grain of data is monthly, it will be first day of month.", + SerializedName = @"usageDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageDate { get; } + /// Total used hours by the reservation + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total used hours by the reservation", + SerializedName = @"usedHours", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UsedHour { get; } + /// This is the used quantity for the reservationId. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the used quantity for the reservationId.", + SerializedName = @"usedQuantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UsedQuantity { get; } + /// This is the utilized percentage for the reservation Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the utilized percentage for the reservation Id.", + SerializedName = @"utilizedPercentage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? UtilizedPercentage { get; } + + } + /// The properties of the reservation summary. + internal partial interface IReservationSummaryPropertiesInternal + + { + /// + /// This is average utilization for the entire time range. (day or month depending on the grain) + /// + decimal? AvgUtilizationPercentage { get; set; } + /// The reservation kind. + string Kind { get; set; } + /// + /// This is the maximum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 + /// and on that for hour 4 and 5, utilization was 100%, this field will return 100% for that day. + /// + decimal? MaxUtilizationPercentage { get; set; } + /// + /// This is the minimum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 + /// and on that for hour 4 and 5, utilization was 10%, this field will return 10% for that day + /// + decimal? MinUtilizationPercentage { get; set; } + /// This is the purchased quantity for the reservationId. + decimal? PurchasedQuantity { get; set; } + /// This is the remaining quantity for the reservationId. + decimal? RemainingQuantity { get; set; } + /// + /// The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for + /// applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied + /// to. + /// + string ReservationId { get; set; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + string ReservationOrderId { get; set; } + /// + /// This is the total hours reserved. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours for that + /// day and 24 hours from subsequent days + /// + decimal? ReservedHour { get; set; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + string SkuName { get; set; } + /// This is the total count of instances that are reserved for the reservationId. + decimal? TotalReservedQuantity { get; set; } + /// + /// Data corresponding to the utilization record. If the grain of data is monthly, it will be first day of month. + /// + global::System.DateTime? UsageDate { get; set; } + /// Total used hours by the reservation + decimal? UsedHour { get; set; } + /// This is the used quantity for the reservationId. + decimal? UsedQuantity { get; set; } + /// This is the utilized percentage for the reservation Id. + decimal? UtilizedPercentage { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummaryProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummaryProperties.json.cs new file mode 100644 index 000000000000..c340da5a638c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationSummaryProperties.json.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the reservation summary. + public partial class ReservationSummaryProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummaryProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationSummaryProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationSummaryProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_reservationOrderId = If( json?.PropertyT("reservationOrderId"), out var __jsonReservationOrderId) ? (string)__jsonReservationOrderId : (string)ReservationOrderId;} + {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)ReservationId;} + {_skuName = If( json?.PropertyT("skuName"), out var __jsonSkuName) ? (string)__jsonSkuName : (string)SkuName;} + {_reservedHour = If( json?.PropertyT("reservedHours"), out var __jsonReservedHours) ? (decimal?)__jsonReservedHours : ReservedHour;} + {_usageDate = If( json?.PropertyT("usageDate"), out var __jsonUsageDate) ? global::System.DateTime.TryParse((string)__jsonUsageDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUsageDateValue) ? __jsonUsageDateValue : UsageDate : UsageDate;} + {_usedHour = If( json?.PropertyT("usedHours"), out var __jsonUsedHours) ? (decimal?)__jsonUsedHours : UsedHour;} + {_minUtilizationPercentage = If( json?.PropertyT("minUtilizationPercentage"), out var __jsonMinUtilizationPercentage) ? (decimal?)__jsonMinUtilizationPercentage : MinUtilizationPercentage;} + {_avgUtilizationPercentage = If( json?.PropertyT("avgUtilizationPercentage"), out var __jsonAvgUtilizationPercentage) ? (decimal?)__jsonAvgUtilizationPercentage : AvgUtilizationPercentage;} + {_maxUtilizationPercentage = If( json?.PropertyT("maxUtilizationPercentage"), out var __jsonMaxUtilizationPercentage) ? (decimal?)__jsonMaxUtilizationPercentage : MaxUtilizationPercentage;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + {_purchasedQuantity = If( json?.PropertyT("purchasedQuantity"), out var __jsonPurchasedQuantity) ? (decimal?)__jsonPurchasedQuantity : PurchasedQuantity;} + {_remainingQuantity = If( json?.PropertyT("remainingQuantity"), out var __jsonRemainingQuantity) ? (decimal?)__jsonRemainingQuantity : RemainingQuantity;} + {_totalReservedQuantity = If( json?.PropertyT("totalReservedQuantity"), out var __jsonTotalReservedQuantity) ? (decimal?)__jsonTotalReservedQuantity : TotalReservedQuantity;} + {_usedQuantity = If( json?.PropertyT("usedQuantity"), out var __jsonUsedQuantity) ? (decimal?)__jsonUsedQuantity : UsedQuantity;} + {_utilizedPercentage = If( json?.PropertyT("utilizedPercentage"), out var __jsonUtilizedPercentage) ? (decimal?)__jsonUtilizedPercentage : UtilizedPercentage;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationOrderId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationOrderId.ToString()) : null, "reservationOrderId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reservationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationId.ToString()) : null, "reservationId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._skuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._skuName.ToString()) : null, "skuName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._reservedHour ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._reservedHour) : null, "reservedHours" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usageDate ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._usageDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "usageDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usedHour ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._usedHour) : null, "usedHours" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._minUtilizationPercentage ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._minUtilizationPercentage) : null, "minUtilizationPercentage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._avgUtilizationPercentage ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._avgUtilizationPercentage) : null, "avgUtilizationPercentage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._maxUtilizationPercentage ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._maxUtilizationPercentage) : null, "maxUtilizationPercentage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._purchasedQuantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._purchasedQuantity) : null, "purchasedQuantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._remainingQuantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._remainingQuantity) : null, "remainingQuantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalReservedQuantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._totalReservedQuantity) : null, "totalReservedQuantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usedQuantity ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._usedQuantity) : null, "usedQuantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._utilizedPercentage ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNumber((decimal)this._utilizedPercentage) : null, "utilizedPercentage" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransaction.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransaction.PowerShell.cs new file mode 100644 index 000000000000..828f471d0c1c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransaction.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Reservation transaction resource. + [System.ComponentModel.TypeConverter(typeof(ReservationTransactionTypeConverter))] + public partial class ReservationTransaction + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationTransaction DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationTransaction(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.Consumption.Models.Api20211001.IReservationTransaction DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationTransaction(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.Consumption.Models.Api20211001.IReservationTransaction FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationTransaction(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.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationTransactionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EventDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventDate = (global::System.DateTime?) content.GetValueForProperty("EventDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventType = (string) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventType, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderName, global::System.Convert.ToString); + } + if (content.Contains("PurchasingEnrollment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingEnrollment = (string) content.GetValueForProperty("PurchasingEnrollment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingEnrollment, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionGuid = (string) content.GetValueForProperty("PurchasingSubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionName = (string) content.GetValueForProperty("PurchasingSubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("ArmSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ArmSkuName = (string) content.GetValueForProperty("ArmSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ArmSkuName, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("AccountOwnerEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountOwnerEmail = (string) content.GetValueForProperty("AccountOwnerEmail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountOwnerEmail, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("CurrentEnrollment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CurrentEnrollment = (string) content.GetValueForProperty("CurrentEnrollment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CurrentEnrollment, global::System.Convert.ToString); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingFrequency = (string) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingFrequency, global::System.Convert.ToString); + } + if (content.Contains("BillingMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingMonth = (int?) content.GetValueForProperty("BillingMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).MonetaryCommitment = (decimal?) content.GetValueForProperty("MonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).MonetaryCommitment, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Overage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Overage = (decimal?) content.GetValueForProperty("Overage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Overage, (__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 ReservationTransaction(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.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationTransactionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EventDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventDate = (global::System.DateTime?) content.GetValueForProperty("EventDate",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventType = (string) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).EventType, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Quantity = (decimal?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Quantity, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ReservationOrderName, global::System.Convert.ToString); + } + if (content.Contains("PurchasingEnrollment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingEnrollment = (string) content.GetValueForProperty("PurchasingEnrollment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingEnrollment, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionGuid = (string) content.GetValueForProperty("PurchasingSubscriptionGuid",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionGuid, global::System.Convert.ToString); + } + if (content.Contains("PurchasingSubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionName = (string) content.GetValueForProperty("PurchasingSubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).PurchasingSubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("ArmSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ArmSkuName = (string) content.GetValueForProperty("ArmSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).ArmSkuName, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("Region")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Region = (string) content.GetValueForProperty("Region",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Region, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("AccountOwnerEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountOwnerEmail = (string) content.GetValueForProperty("AccountOwnerEmail",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).AccountOwnerEmail, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("CostCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CostCenter = (string) content.GetValueForProperty("CostCenter",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CostCenter, global::System.Convert.ToString); + } + if (content.Contains("CurrentEnrollment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CurrentEnrollment = (string) content.GetValueForProperty("CurrentEnrollment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).CurrentEnrollment, global::System.Convert.ToString); + } + if (content.Contains("BillingFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingFrequency = (string) content.GetValueForProperty("BillingFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingFrequency, global::System.Convert.ToString); + } + if (content.Contains("BillingMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingMonth = (int?) content.GetValueForProperty("BillingMonth",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).BillingMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).MonetaryCommitment = (decimal?) content.GetValueForProperty("MonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).MonetaryCommitment, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Overage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Overage = (decimal?) content.GetValueForProperty("Overage",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal)this).Overage, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Reservation transaction resource. + [System.ComponentModel.TypeConverter(typeof(ReservationTransactionTypeConverter))] + public partial interface IReservationTransaction + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransaction.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransaction.TypeConverter.cs new file mode 100644 index 000000000000..b5f0a71bfc93 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransaction.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationTransactionTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationTransaction ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationTransaction.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationTransaction.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationTransaction.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/consumption/generated/api/Models/Api20211001/ReservationTransaction.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransaction.cs new file mode 100644 index 000000000000..f07b350387f0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransaction.cs @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Reservation transaction resource. + public partial class ReservationTransaction : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResource __reservationTransactionResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransactionResource(); + + /// The name of the account that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).AccountName; } + + /// The email of the account owner that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string AccountOwnerEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).AccountOwnerEmail; } + + /// The charge of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? Amount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Amount; } + + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ArmSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).ArmSkuName; } + + /// The billing frequency, which can be either one-time or recurring. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string BillingFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).BillingFrequency; } + + /// The billing month(yyyyMMdd), on which the event initiated. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public int? BillingMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).BillingMonth; } + + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CostCenter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).CostCenter; } + + /// The ISO currency in which the transaction is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Currency; } + + /// The current enrollment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string CurrentEnrollment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).CurrentEnrollment; } + + /// The department name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string DepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).DepartmentName; } + + /// The description of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Description; } + + /// The date of the transaction + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public global::System.DateTime? EventDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).EventDate; } + + /// The type of the transaction (Purchase, Cancel or Refund). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string EventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).EventType; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Id; } + + /// Internal Acessors for AccountName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.AccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).AccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).AccountName = value; } + + /// Internal Acessors for AccountOwnerEmail + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.AccountOwnerEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).AccountOwnerEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).AccountOwnerEmail = value; } + + /// Internal Acessors for Amount + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Amount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Amount = value; } + + /// Internal Acessors for ArmSkuName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.ArmSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).ArmSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).ArmSkuName = value; } + + /// Internal Acessors for BillingFrequency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.BillingFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).BillingFrequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).BillingFrequency = value; } + + /// Internal Acessors for BillingMonth + int? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.BillingMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).BillingMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).BillingMonth = value; } + + /// Internal Acessors for CostCenter + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.CostCenter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).CostCenter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).CostCenter = value; } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Currency = value; } + + /// Internal Acessors for CurrentEnrollment + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.CurrentEnrollment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).CurrentEnrollment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).CurrentEnrollment = value; } + + /// Internal Acessors for DepartmentName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.DepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).DepartmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).DepartmentName = value; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Description = value; } + + /// Internal Acessors for EventDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.EventDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).EventDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).EventDate = value; } + + /// Internal Acessors for EventType + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.EventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).EventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).EventType = value; } + + /// Internal Acessors for MonetaryCommitment + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.MonetaryCommitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).MonetaryCommitment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).MonetaryCommitment = value; } + + /// Internal Acessors for Overage + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Overage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Overage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Overage = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationTransactionProperties()); set { {_property = value;} } } + + /// Internal Acessors for PurchasingEnrollment + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.PurchasingEnrollment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).PurchasingEnrollment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).PurchasingEnrollment = value; } + + /// Internal Acessors for PurchasingSubscriptionGuid + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.PurchasingSubscriptionGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).PurchasingSubscriptionGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).PurchasingSubscriptionGuid = value; } + + /// Internal Acessors for PurchasingSubscriptionName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.PurchasingSubscriptionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).PurchasingSubscriptionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).PurchasingSubscriptionName = value; } + + /// Internal Acessors for Quantity + decimal? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Quantity = value; } + + /// Internal Acessors for Region + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Region { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Region; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Region = value; } + + /// Internal Acessors for ReservationOrderId + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).ReservationOrderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).ReservationOrderId = value; } + + /// Internal Acessors for ReservationOrderName + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.ReservationOrderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).ReservationOrderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).ReservationOrderName = value; } + + /// Internal Acessors for Term + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionInternal.Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Term = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Name = value; } + + /// Internal Acessors for Tag + string[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Type = value; } + + /// The monetary commitment amount at the enrollment scope. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? MonetaryCommitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).MonetaryCommitment; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Name; } + + /// The overage amount at the enrollment scope. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? Overage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Overage; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties _property; + + /// The properties of a legacy reservation transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationTransactionProperties()); set => this._property = value; } + + /// The purchasing enrollment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PurchasingEnrollment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).PurchasingEnrollment; } + + /// The subscription guid that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PurchasingSubscriptionGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).PurchasingSubscriptionGuid; } + + /// The subscription name that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PurchasingSubscriptionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).PurchasingSubscriptionName; } + + /// The quantity of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public decimal? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Quantity; } + + /// The region of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Region { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Region; } + + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).ReservationOrderId; } + + /// The name of the reservation order. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string ReservationOrderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).ReservationOrderName; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string[] Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Tag; } + + /// This is the term of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionPropertiesInternal)Property).Term; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)__reservationTransactionResource).Type; } + + /// Creates an new instance. + public ReservationTransaction() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__reservationTransactionResource), __reservationTransactionResource); + await eventListener.AssertObjectIsValid(nameof(__reservationTransactionResource), __reservationTransactionResource); + } + } + /// Reservation transaction resource. + public partial interface IReservationTransaction : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResource + { + /// The name of the account that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the account that makes the transaction.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + string AccountName { get; } + /// The email of the account owner that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The email of the account owner that makes the transaction.", + SerializedName = @"accountOwnerEmail", + PossibleTypes = new [] { typeof(string) })] + string AccountOwnerEmail { get; } + /// The charge of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The charge of the transaction.", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Amount { get; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records.", + SerializedName = @"armSkuName", + PossibleTypes = new [] { typeof(string) })] + string ArmSkuName { get; } + /// The billing frequency, which can be either one-time or recurring. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing frequency, which can be either one-time or recurring.", + SerializedName = @"billingFrequency", + PossibleTypes = new [] { typeof(string) })] + string BillingFrequency { get; } + /// The billing month(yyyyMMdd), on which the event initiated. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The billing month(yyyyMMdd), on which the event initiated.", + SerializedName = @"billingMonth", + PossibleTypes = new [] { typeof(int) })] + int? BillingMonth { get; } + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The cost center of this department if it is a department and a cost center is provided.", + SerializedName = @"costCenter", + PossibleTypes = new [] { typeof(string) })] + string CostCenter { get; } + /// The ISO currency in which the transaction is charged, for example, USD. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ISO currency in which the transaction is charged, for example, USD.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// The current enrollment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current enrollment.", + SerializedName = @"currentEnrollment", + PossibleTypes = new [] { typeof(string) })] + string CurrentEnrollment { get; } + /// The department name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The department name.", + SerializedName = @"departmentName", + PossibleTypes = new [] { typeof(string) })] + string DepartmentName { get; } + /// The description of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The description of the transaction.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// The date of the transaction + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date of the transaction", + SerializedName = @"eventDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EventDate { get; } + /// The type of the transaction (Purchase, Cancel or Refund). + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the transaction (Purchase, Cancel or Refund).", + SerializedName = @"eventType", + PossibleTypes = new [] { typeof(string) })] + string EventType { get; } + /// The monetary commitment amount at the enrollment scope. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The monetary commitment amount at the enrollment scope.", + SerializedName = @"monetaryCommitment", + PossibleTypes = new [] { typeof(decimal) })] + decimal? MonetaryCommitment { get; } + /// The overage amount at the enrollment scope. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The overage amount at the enrollment scope.", + SerializedName = @"overage", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Overage { get; } + /// The purchasing enrollment. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The purchasing enrollment.", + SerializedName = @"purchasingEnrollment", + PossibleTypes = new [] { typeof(string) })] + string PurchasingEnrollment { get; } + /// The subscription guid that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subscription guid that makes the transaction.", + SerializedName = @"purchasingSubscriptionGuid", + PossibleTypes = new [] { typeof(string) })] + string PurchasingSubscriptionGuid { get; } + /// The subscription name that makes the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subscription name that makes the transaction.", + SerializedName = @"purchasingSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + string PurchasingSubscriptionName { get; } + /// The quantity of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The quantity of the transaction.", + SerializedName = @"quantity", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Quantity { get; } + /// The region of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The region of the transaction.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + string Region { get; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations.", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderId { get; } + /// The name of the reservation order. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the reservation order.", + SerializedName = @"reservationOrderName", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderName { get; } + /// This is the term of the transaction. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the term of the transaction.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(string) })] + string Term { get; } + + } + /// Reservation transaction resource. + internal partial interface IReservationTransactionInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal + { + /// The name of the account that makes the transaction. + string AccountName { get; set; } + /// The email of the account owner that makes the transaction. + string AccountOwnerEmail { get; set; } + /// The charge of the transaction. + decimal? Amount { get; set; } + /// + /// This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. + /// + string ArmSkuName { get; set; } + /// The billing frequency, which can be either one-time or recurring. + string BillingFrequency { get; set; } + /// The billing month(yyyyMMdd), on which the event initiated. + int? BillingMonth { get; set; } + /// + /// The cost center of this department if it is a department and a cost center is provided. + /// + string CostCenter { get; set; } + /// The ISO currency in which the transaction is charged, for example, USD. + string Currency { get; set; } + /// The current enrollment. + string CurrentEnrollment { get; set; } + /// The department name. + string DepartmentName { get; set; } + /// The description of the transaction. + string Description { get; set; } + /// The date of the transaction + global::System.DateTime? EventDate { get; set; } + /// The type of the transaction (Purchase, Cancel or Refund). + string EventType { get; set; } + /// The monetary commitment amount at the enrollment scope. + decimal? MonetaryCommitment { get; set; } + /// The overage amount at the enrollment scope. + decimal? Overage { get; set; } + /// The properties of a legacy reservation transaction. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILegacyReservationTransactionProperties Property { get; set; } + /// The purchasing enrollment. + string PurchasingEnrollment { get; set; } + /// The subscription guid that makes the transaction. + string PurchasingSubscriptionGuid { get; set; } + /// The subscription name that makes the transaction. + string PurchasingSubscriptionName { get; set; } + /// The quantity of the transaction. + decimal? Quantity { get; set; } + /// The region of the transaction. + string Region { get; set; } + /// + /// The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the + /// reservations. + /// + string ReservationOrderId { get; set; } + /// The name of the reservation order. + string ReservationOrderName { get; set; } + /// This is the term of the transaction. + string Term { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransaction.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransaction.json.cs new file mode 100644 index 000000000000..b15213072215 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransaction.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Reservation transaction resource. + public partial class ReservationTransaction + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationTransaction(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationTransaction(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __reservationTransactionResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransactionResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.LegacyReservationTransactionProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __reservationTransactionResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ReservationTransactionResource.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionResource.PowerShell.cs new file mode 100644 index 000000000000..9c15cc6dbb46 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionResource.PowerShell.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The Resource model definition. + [System.ComponentModel.TypeConverter(typeof(ReservationTransactionResourceTypeConverter))] + public partial class ReservationTransactionResource + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationTransactionResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationTransactionResource(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.Consumption.Models.Api20211001.IReservationTransactionResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationTransactionResource(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.Consumption.Models.Api20211001.IReservationTransactionResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationTransactionResource(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.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag, __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 ReservationTransactionResource(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.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal)this).Tag, __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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Resource model definition. + [System.ComponentModel.TypeConverter(typeof(ReservationTransactionResourceTypeConverter))] + public partial interface IReservationTransactionResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionResource.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionResource.TypeConverter.cs new file mode 100644 index 000000000000..724aba51ee79 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionResource.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationTransactionResourceTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationTransactionResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationTransactionResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationTransactionResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationTransactionResource.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/consumption/generated/api/Models/Api20211001/ReservationTransactionResource.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionResource.cs new file mode 100644 index 000000000000..6e0497c9f364 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionResource.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The Resource model definition. + public partial class ReservationTransactionResource : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResource, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal + { + + /// Backing field for property. + private string _id; + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Tag + string[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Tag { get => this._tag; set { {_tag = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string[] _tag; + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string[] Tag { get => this._tag; } + + /// Backing field for property. + private string _type; + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ReservationTransactionResource() + { + + } + } + /// The Resource model definition. + public partial interface IReservationTransactionResource : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Id.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(string) })] + string[] Tag { get; } + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 IReservationTransactionResourceInternal + + { + /// Resource Id. + string Id { get; set; } + /// Resource name. + string Name { get; set; } + /// Resource tags. + string[] Tag { get; set; } + /// Resource type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionResource.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionResource.json.cs new file mode 100644 index 000000000000..d8ff39b2d709 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionResource.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The Resource model definition. + public partial class ReservationTransactionResource + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationTransactionResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationTransactionResource(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._tag) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._tag ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("tags",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionsListResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionsListResult.PowerShell.cs new file mode 100644 index 000000000000..3e0becb70631 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionsListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// Result of listing reservation recommendations. + [System.ComponentModel.TypeConverter(typeof(ReservationTransactionsListResultTypeConverter))] + public partial class ReservationTransactionsListResult + { + + /// + /// 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.Consumption.Models.Api20211001.IReservationTransactionsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationTransactionsListResult(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.Consumption.Models.Api20211001.IReservationTransactionsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationTransactionsListResult(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.Consumption.Models.Api20211001.IReservationTransactionsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationTransactionsListResult(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.Consumption.Models.Api20211001.IReservationTransactionsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransactionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResultInternal)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 ReservationTransactionsListResult(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.Consumption.Models.Api20211001.IReservationTransactionsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransactionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResultInternal)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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing reservation recommendations. + [System.ComponentModel.TypeConverter(typeof(ReservationTransactionsListResultTypeConverter))] + public partial interface IReservationTransactionsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionsListResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionsListResult.TypeConverter.cs new file mode 100644 index 000000000000..3059345fd0c0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionsListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReservationTransactionsListResultTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IReservationTransactionsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReservationTransactionsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReservationTransactionsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReservationTransactionsListResult.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/consumption/generated/api/Models/Api20211001/ReservationTransactionsListResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionsListResult.cs new file mode 100644 index 000000000000..281934b4005e --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionsListResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing reservation recommendations. + public partial class ReservationTransactionsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResultInternal.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction[] _value; + + /// The list of reservation recommendations. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction[] Value { get => this._value; } + + /// Creates an new instance. + public ReservationTransactionsListResult() + { + + } + } + /// Result of listing reservation recommendations. + public partial interface IReservationTransactionsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 reservation recommendations. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of reservation recommendations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction[] Value { get; } + + } + /// Result of listing reservation recommendations. + internal partial interface IReservationTransactionsListResultInternal + + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The list of reservation recommendations. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionsListResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionsListResult.json.cs new file mode 100644 index 000000000000..c781978238df --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ReservationTransactionsListResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Result of listing reservation recommendations. + public partial class ReservationTransactionsListResult + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransactionsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ReservationTransactionsListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ReservationTransactionsListResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IReservationTransaction) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ReservationTransaction.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/Resource.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Resource.PowerShell.cs new file mode 100644 index 000000000000..ac093dbcc485 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Resource.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/Resource.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Resource.TypeConverter.cs new file mode 100644 index 000000000000..5037379463eb --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/Resource.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Resource.cs new file mode 100644 index 000000000000..29dd4736374f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Resource.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The Resource model definition. + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal + { + + /// Backing field for property. + private string _etag; + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private string _id; + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTags()); set { {_tag = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags _tag; + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTags()); } + + /// Backing field for property. + private string _type; + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IJsonSerializable + { + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The etag for the resource.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The full qualified ARM ID of an event.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ID that uniquely identifies an event. ", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get; } + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 + + { + /// The etag for the resource. + string Etag { get; set; } + /// The full qualified ARM ID of an event. + string Id { get; set; } + /// The ID that uniquely identifies an event. + string Name { get; set; } + /// Resource tags. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get; set; } + /// Resource type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Resource.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Resource.json.cs new file mode 100644 index 000000000000..6ee82da756cd --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Resource.json.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new Resource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal Resource(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ResourceAttributes.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceAttributes.PowerShell.cs new file mode 100644 index 000000000000..0678d4278c94 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceAttributes.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The Resource model definition. + [System.ComponentModel.TypeConverter(typeof(ResourceAttributesTypeConverter))] + public partial class ResourceAttributes + { + + /// + /// 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.Consumption.Models.Api20211001.IResourceAttributes DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceAttributes(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.Consumption.Models.Api20211001.IResourceAttributes DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceAttributes(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.Consumption.Models.Api20211001.IResourceAttributes FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceAttributes(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.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku, 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 ResourceAttributes(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.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal)this).Sku, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Resource model definition. + [System.ComponentModel.TypeConverter(typeof(ResourceAttributesTypeConverter))] + public partial interface IResourceAttributes + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ResourceAttributes.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceAttributes.TypeConverter.cs new file mode 100644 index 000000000000..f98640800611 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceAttributes.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceAttributesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IResourceAttributes ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributes).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceAttributes.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceAttributes.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceAttributes.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/consumption/generated/api/Models/Api20211001/ResourceAttributes.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceAttributes.cs new file mode 100644 index 000000000000..20acb6d3453b --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceAttributes.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The Resource model definition. + public partial class ResourceAttributes : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributes, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal + { + + /// Backing field for property. + private string _location; + + /// Resource location + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Location { get => this._location; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for Sku + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributesInternal.Sku { get => this._sku; set { {_sku = value;} } } + + /// Backing field for property. + private string _sku; + + /// Resource sku + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Sku { get => this._sku; } + + /// Creates an new instance. + public ResourceAttributes() + { + + } + } + /// The Resource model definition. + public partial interface IResourceAttributes : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Resource location + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource location", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; } + /// Resource sku + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource sku", + SerializedName = @"sku", + PossibleTypes = new [] { typeof(string) })] + string Sku { get; } + + } + /// The Resource model definition. + internal partial interface IResourceAttributesInternal + + { + /// Resource location + string Location { get; set; } + /// Resource sku + string Sku { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ResourceAttributes.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceAttributes.json.cs new file mode 100644 index 000000000000..6d52af8a33fd --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceAttributes.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The Resource model definition. + public partial class ResourceAttributes + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributes. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributes. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceAttributes FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ResourceAttributes(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceAttributes(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? (string)__jsonSku : (string)Sku;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sku)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._sku.ToString()) : null, "sku" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ResourceTags.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceTags.PowerShell.cs new file mode 100644 index 000000000000..a379eadf5c1a --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/ResourceTags.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceTags.TypeConverter.cs new file mode 100644 index 000000000000..d620beefb72a --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IResourceTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Models/Api20211001/ResourceTags.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceTags.cs new file mode 100644 index 000000000000..2e5a6c57acb4 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// Resource tags. + public partial class ResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTagsInternal + { + + /// Creates an new instance. + public ResourceTags() + { + + } + } + /// Resource tags. + public partial interface IResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ResourceTags.dictionary.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceTags.dictionary.cs new file mode 100644 index 000000000000..7d74eec38dab --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + public partial class ResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.ResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/ResourceTags.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/ResourceTags.json.cs new file mode 100644 index 000000000000..a4d4fb8636c4 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ResourceTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ResourceTags(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/SkuProperty.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/SkuProperty.PowerShell.cs new file mode 100644 index 000000000000..7645693ca52a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/SkuProperty.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The Sku property + [System.ComponentModel.TypeConverter(typeof(SkuPropertyTypeConverter))] + public partial class SkuProperty + { + + /// + /// 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.Consumption.Models.Api20211001.ISkuProperty DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SkuProperty(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.Consumption.Models.Api20211001.ISkuProperty DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SkuProperty(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.Consumption.Models.Api20211001.ISkuProperty FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SkuProperty(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.Consumption.Models.Api20211001.ISkuPropertyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuPropertyInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuPropertyInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuPropertyInternal)this).Value, 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 SkuProperty(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.Consumption.Models.Api20211001.ISkuPropertyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuPropertyInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuPropertyInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuPropertyInternal)this).Value, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Sku property + [System.ComponentModel.TypeConverter(typeof(SkuPropertyTypeConverter))] + public partial interface ISkuProperty + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/SkuProperty.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/SkuProperty.TypeConverter.cs new file mode 100644 index 000000000000..1169758e30dd --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/SkuProperty.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SkuPropertyTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ISkuProperty ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SkuProperty.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SkuProperty.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SkuProperty.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/consumption/generated/api/Models/Api20211001/SkuProperty.cs b/swaggerci/consumption/generated/api/Models/Api20211001/SkuProperty.cs new file mode 100644 index 000000000000..a33096aaaac3 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/SkuProperty.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The Sku property + public partial class SkuProperty : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuPropertyInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuPropertyInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Value + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuPropertyInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of sku property. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _value; + + /// The value of sku property. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Value { get => this._value; } + + /// Creates an new instance. + public SkuProperty() + { + + } + } + /// The Sku property + public partial interface ISkuProperty : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The name of sku property. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of sku property.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The value of sku property. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The value of sku property.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; } + + } + /// The Sku property + internal partial interface ISkuPropertyInternal + + { + /// The name of sku property. + string Name { get; set; } + /// The value of sku property. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/SkuProperty.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/SkuProperty.json.cs new file mode 100644 index 000000000000..421aff73db3f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/SkuProperty.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The Sku property + public partial class SkuProperty + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ISkuProperty FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new SkuProperty(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal SkuProperty(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Tag.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Tag.PowerShell.cs new file mode 100644 index 000000000000..eb47c800412d --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Tag.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The tag resource. + [System.ComponentModel.TypeConverter(typeof(TagTypeConverter))] + public partial class Tag + { + + /// + /// 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.Consumption.Models.Api20211001.ITag DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Tag(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.Consumption.Models.Api20211001.ITag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Tag(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.Consumption.Models.Api20211001.ITag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Tag(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagInternal)this).Key, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagInternal)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 Tag(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagInternal)this).Key, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagInternal)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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The tag resource. + [System.ComponentModel.TypeConverter(typeof(TagTypeConverter))] + public partial interface ITag + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Tag.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Tag.TypeConverter.cs new file mode 100644 index 000000000000..447dd4951f2a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Tag.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TagTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ITag ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Tag.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Tag.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Tag.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/consumption/generated/api/Models/Api20211001/Tag.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Tag.cs new file mode 100644 index 000000000000..c1971e6bfbbf --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Tag.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The tag resource. + public partial class Tag : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagInternal + { + + /// Backing field for property. + private string _key; + + /// Tag key. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Key { get => this._key; set => this._key = value; } + + /// Backing field for property. + private string[] _value; + + /// Tag values. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public Tag() + { + + } + } + /// The tag resource. + public partial interface ITag : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// Tag key. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag key.", + SerializedName = @"key", + PossibleTypes = new [] { typeof(string) })] + string Key { get; set; } + /// Tag values. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// The tag resource. + internal partial interface ITagInternal + + { + /// Tag key. + string Key { get; set; } + /// Tag values. + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/Tag.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/Tag.json.cs new file mode 100644 index 000000000000..b3ab9f9789f8 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/Tag.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The tag resource. + public partial class Tag + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new Tag(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal Tag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._key)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._key.ToString()) : null, "key" ,container.Add ); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/TagProperties.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/TagProperties.PowerShell.cs new file mode 100644 index 000000000000..23977e17803c --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/TagProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// The properties of the tag. + [System.ComponentModel.TypeConverter(typeof(TagPropertiesTypeConverter))] + public partial class TagProperties + { + + /// + /// 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.Consumption.Models.Api20211001.ITagProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TagProperties(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.Consumption.Models.Api20211001.ITagProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TagProperties(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.Consumption.Models.Api20211001.ITagProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TagProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("PreviousLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)this).PreviousLink = (string) content.GetValueForProperty("PreviousLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)this).PreviousLink, 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 TagProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("PreviousLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)this).PreviousLink = (string) content.GetValueForProperty("PreviousLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)this).PreviousLink, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the tag. + [System.ComponentModel.TypeConverter(typeof(TagPropertiesTypeConverter))] + public partial interface ITagProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/TagProperties.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/TagProperties.TypeConverter.cs new file mode 100644 index 000000000000..d64b392f5b80 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/TagProperties.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TagPropertiesTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ITagProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TagProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TagProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TagProperties.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/consumption/generated/api/Models/Api20211001/TagProperties.cs b/swaggerci/consumption/generated/api/Models/Api20211001/TagProperties.cs new file mode 100644 index 000000000000..a5ee8132ba7f --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/TagProperties.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the tag. + public partial class TagProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagProperties, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for PreviousLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal.PreviousLink { get => this._previousLink; set { {_previousLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private string _previousLink; + + /// The link (url) to the previous page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string PreviousLink { get => this._previousLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag[] _tag; + + /// A list of Tag. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag[] Tag { get => this._tag; set => this._tag = value; } + + /// Creates an new instance. + public TagProperties() + { + + } + } + /// The properties of the tag. + public partial interface ITagProperties : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 link (url) to the previous page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The link (url) to the previous page of results.", + SerializedName = @"previousLink", + PossibleTypes = new [] { typeof(string) })] + string PreviousLink { get; } + /// A list of Tag. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of Tag.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag[] Tag { get; set; } + + } + /// The properties of the tag. + internal partial interface ITagPropertiesInternal + + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The link (url) to the previous page of results. + string PreviousLink { get; set; } + /// A list of Tag. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag[] Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/TagProperties.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/TagProperties.json.cs new file mode 100644 index 000000000000..e12143cccfa9 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/TagProperties.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// The properties of the tag. + public partial class TagProperties + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new TagProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal TagProperties(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ITag) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Tag.FromJson(__u) )) ))() : null : Tag;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_previousLink = If( json?.PropertyT("previousLink"), out var __jsonPreviousLink) ? (string)__jsonPreviousLink : (string)PreviousLink;} + 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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._tag) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.XNodeArray(); + foreach( var __x in this._tag ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("tags",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._previousLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._previousLink.ToString()) : null, "previousLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/TagsResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/TagsResult.PowerShell.cs new file mode 100644 index 000000000000..a2bb9e2ba19b --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/TagsResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// A resource listing all tags. + [System.ComponentModel.TypeConverter(typeof(TagsResultTypeConverter))] + public partial class TagsResult + { + + /// + /// 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.Consumption.Models.Api20211001.ITagsResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TagsResult(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.Consumption.Models.Api20211001.ITagsResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TagsResult(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.Consumption.Models.Api20211001.ITagsResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TagsResult(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.Consumption.Models.Api20211001.ITagsResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("PreviousLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).PreviousLink = (string) content.GetValueForProperty("PreviousLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).PreviousLink, 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 TagsResult(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.Consumption.Models.Api20211001.ITagsResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("PreviousLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).PreviousLink = (string) content.GetValueForProperty("PreviousLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal)this).PreviousLink, 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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A resource listing all tags. + [System.ComponentModel.TypeConverter(typeof(TagsResultTypeConverter))] + public partial interface ITagsResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/TagsResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/TagsResult.TypeConverter.cs new file mode 100644 index 000000000000..0268b4d3a027 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/TagsResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TagsResultTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.ITagsResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TagsResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TagsResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TagsResult.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/consumption/generated/api/Models/Api20211001/TagsResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/TagsResult.cs new file mode 100644 index 000000000000..602becd3519a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/TagsResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A resource listing all tags. + public partial class TagsResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ProxyResource(); + + /// + /// 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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal.NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)Property).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)Property).NextLink = value; } + + /// Internal Acessors for PreviousLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal.PreviousLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)Property).PreviousLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)Property).PreviousLink = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagProperties Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagProperties()); set { {_property = value;} } } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)Property).NextLink; } + + /// The link (url) to the previous page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public string PreviousLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)Property).PreviousLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagProperties _property; + + /// The properties of the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagProperties()); set => this._property = value; } + + /// A list of Tag. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag[] Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagPropertiesInternal)Property).Tag = value ?? null /* arrayOf */; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public TagsResult() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// A resource listing all tags. + public partial interface ITagsResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResource + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 link (url) to the previous page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The link (url) to the previous page of results.", + SerializedName = @"previousLink", + PossibleTypes = new [] { typeof(string) })] + string PreviousLink { get; } + /// A list of Tag. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of Tag.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag[] Tag { get; set; } + + } + /// A resource listing all tags. + internal partial interface ITagsResultInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IProxyResourceInternal + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The link (url) to the previous page of results. + string PreviousLink { get; set; } + /// The properties of the tag. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagProperties Property { get; set; } + /// A list of Tag. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITag[] Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/TagsResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/TagsResult.json.cs new file mode 100644 index 000000000000..483e3a4f0332 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/TagsResult.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.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// A resource listing all tags. + public partial class TagsResult + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new TagsResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal TagsResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.TagProperties.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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/api/Models/Api20211001/UsageDetail.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetail.PowerShell.cs new file mode 100644 index 000000000000..60bffeacb7cd --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetail.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// An usage detail resource. + [System.ComponentModel.TypeConverter(typeof(UsageDetailTypeConverter))] + public partial class UsageDetail + { + + /// + /// 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.Consumption.Models.Api20211001.IUsageDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UsageDetail(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.Consumption.Models.Api20211001.IUsageDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UsageDetail(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.Consumption.Models.Api20211001.IUsageDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UsageDetail(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 UsageDetail(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + } + /// An usage detail resource. + [System.ComponentModel.TypeConverter(typeof(UsageDetailTypeConverter))] + public partial interface IUsageDetail + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetail.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetail.TypeConverter.cs new file mode 100644 index 000000000000..b3b02e0689df --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetail.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UsageDetailTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IUsageDetail ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UsageDetail.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UsageDetail.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UsageDetail.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/consumption/generated/api/Models/Api20211001/UsageDetail.cs b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetail.cs new file mode 100644 index 000000000000..ca6fa1956edc --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetail.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// An usage detail resource. + public partial class UsageDetail : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailInternal, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(); + + /// The etag for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; } + + /// The full qualified ARM ID of an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind _kind; + + /// Specifies the kind of usage details. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind Kind { get => this._kind; set => this._kind = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// The ID that uniquely identifies an event. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public UsageDetail() + { + + } + + /// 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.Consumption.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// An usage detail resource. + public partial interface IUsageDetail : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResource + { + /// Specifies the kind of usage details. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the kind of usage details.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind Kind { get; set; } + + } + /// An usage detail resource. + internal partial interface IUsageDetailInternal : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IResourceInternal + { + /// Specifies the kind of usage details. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind Kind { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetail.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetail.json.cs new file mode 100644 index 000000000000..a522d4d506f8 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetail.json.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// An usage detail resource. + public partial class UsageDetail + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail interface is polymorphic, and + /// the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("kind") ) + { + case "legacy": + { + return new LegacyUsageDetail(json); + } + case "modern": + { + return new ModernUsageDetail(json); + } + } + return new UsageDetail(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal UsageDetail(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Resource(json); + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetailsListResult.PowerShell.cs b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetailsListResult.PowerShell.cs new file mode 100644 index 000000000000..e69778377e05 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetailsListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing + /// period. + /// + [System.ComponentModel.TypeConverter(typeof(UsageDetailsListResultTypeConverter))] + public partial class UsageDetailsListResult + { + + /// + /// 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.Consumption.Models.Api20211001.IUsageDetailsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UsageDetailsListResult(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.Consumption.Models.Api20211001.IUsageDetailsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UsageDetailsListResult(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.Consumption.Models.Api20211001.IUsageDetailsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UsageDetailsListResult(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.Consumption.Models.Api20211001.IUsageDetailsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.UsageDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResultInternal)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 UsageDetailsListResult(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.Consumption.Models.Api20211001.IUsageDetailsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.UsageDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing + /// period. + [System.ComponentModel.TypeConverter(typeof(UsageDetailsListResultTypeConverter))] + public partial interface IUsageDetailsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetailsListResult.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetailsListResult.TypeConverter.cs new file mode 100644 index 000000000000..e220003994ae --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetailsListResult.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.Consumption.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UsageDetailsListResultTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IUsageDetailsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UsageDetailsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UsageDetailsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UsageDetailsListResult.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/consumption/generated/api/Models/Api20211001/UsageDetailsListResult.cs b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetailsListResult.cs new file mode 100644 index 000000000000..3db240c4ba62 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetailsListResult.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing + /// period. + /// + public partial class UsageDetailsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResult, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail[] Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResultInternal.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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail[] _value; + + /// The list of usage details. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail[] Value { get => this._value; } + + /// Creates an new instance. + public UsageDetailsListResult() + { + + } + } + /// Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing + /// period. + public partial interface IUsageDetailsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 usage details. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of usage details.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail[] Value { get; } + + } + /// Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing + /// period. + internal partial interface IUsageDetailsListResultInternal + + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The list of usage details. + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetailsListResult.json.cs b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetailsListResult.json.cs new file mode 100644 index 000000000000..3ad10b0c0188 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/Api20211001/UsageDetailsListResult.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + /// + /// Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing + /// period. + /// + public partial class UsageDetailsListResult + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetailsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new UsageDetailsListResult(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal UsageDetailsListResult(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IUsageDetail) (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.UsageDetail.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/consumption/generated/api/Models/ConsumptionIdentity.PowerShell.cs b/swaggerci/consumption/generated/api/Models/ConsumptionIdentity.PowerShell.cs new file mode 100644 index 000000000000..719a11f90b68 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/ConsumptionIdentity.PowerShell.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ConsumptionIdentityTypeConverter))] + public partial class ConsumptionIdentity + { + + /// + /// 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 ConsumptionIdentity(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.Consumption.Models.IConsumptionIdentityInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("BudgetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BudgetName = (string) content.GetValueForProperty("BudgetName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BudgetName, global::System.Convert.ToString); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("BillingPeriodName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BillingPeriodName = (string) content.GetValueForProperty("BillingPeriodName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BillingPeriodName, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("ResourceScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ResourceScope = (string) content.GetValueForProperty("ResourceScope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ResourceScope, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ManagementGroupId = (string) content.GetValueForProperty("ManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("CustomerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).CustomerId = (string) content.GetValueForProperty("CustomerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).CustomerId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)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 ConsumptionIdentity(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.Consumption.Models.IConsumptionIdentityInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("BudgetName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BudgetName = (string) content.GetValueForProperty("BudgetName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BudgetName, global::System.Convert.ToString); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("BillingPeriodName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BillingPeriodName = (string) content.GetValueForProperty("BillingPeriodName",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BillingPeriodName, global::System.Convert.ToString); + } + if (content.Contains("ReservationOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ReservationOrderId, global::System.Convert.ToString); + } + if (content.Contains("ReservationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ReservationId, global::System.Convert.ToString); + } + if (content.Contains("ResourceScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ResourceScope = (string) content.GetValueForProperty("ResourceScope",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ResourceScope, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ManagementGroupId = (string) content.GetValueForProperty("ManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).ManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("CustomerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).CustomerId = (string) content.GetValueForProperty("CustomerId",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).CustomerId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal)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.Consumption.Models.IConsumptionIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConsumptionIdentity(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.Consumption.Models.IConsumptionIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConsumptionIdentity(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.Consumption.Models.IConsumptionIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ConsumptionIdentityTypeConverter))] + public partial interface IConsumptionIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/ConsumptionIdentity.TypeConverter.cs b/swaggerci/consumption/generated/api/Models/ConsumptionIdentity.TypeConverter.cs new file mode 100644 index 000000000000..25d3de943239 --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/ConsumptionIdentity.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.Consumption.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConsumptionIdentityTypeConverter : 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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.IConsumptionIdentity 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 ConsumptionIdentity { Id = sourceValue }; + } + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConsumptionIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConsumptionIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConsumptionIdentity.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/consumption/generated/api/Models/ConsumptionIdentity.cs b/swaggerci/consumption/generated/api/Models/ConsumptionIdentity.cs new file mode 100644 index 000000000000..9bd4a5c78baf --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/ConsumptionIdentity.cs @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + public partial class ConsumptionIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentityInternal + { + + /// Backing field for property. + private string _billingAccountId; + + /// BillingAccount ID + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingAccountId { get => this._billingAccountId; set => this._billingAccountId = value; } + + /// Backing field for property. + private string _billingPeriodName; + + /// Billing Period Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingPeriodName { get => this._billingPeriodName; set => this._billingPeriodName = value; } + + /// Backing field for property. + private string _billingProfileId; + + /// Azure Billing Profile ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BillingProfileId { get => this._billingProfileId; set => this._billingProfileId = value; } + + /// Backing field for property. + private string _budgetName; + + /// Budget Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string BudgetName { get => this._budgetName; set => this._budgetName = value; } + + /// Backing field for property. + private string _customerId; + + /// Customer ID + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string CustomerId { get => this._customerId; set => this._customerId = value; } + + /// Backing field for property. + private string _id; + + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _managementGroupId; + + /// Azure Management Group ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ManagementGroupId { get => this._managementGroupId; set => this._managementGroupId = value; } + + /// Backing field for property. + private string _reservationId; + + /// Id of the reservation + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationId { get => this._reservationId; set => this._reservationId = value; } + + /// Backing field for property. + private string _reservationOrderId; + + /// Order Id of the reservation + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ReservationOrderId { get => this._reservationOrderId; set => this._reservationOrderId = value; } + + /// Backing field for property. + private string _resourceScope; + + /// + /// The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for BillingProfile scope (modern). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string ResourceScope { get => this._resourceScope; set => this._resourceScope = 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 + /// and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, + /// billing account, department, enrollment account and management group, you can also add billing period to the scope using + /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope + /// use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + /// 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.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Azure Subscription ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Origin(Microsoft.Azure.PowerShell.Cmdlets.Consumption.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Creates an new instance. + public ConsumptionIdentity() + { + + } + } + public partial interface IConsumptionIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IJsonSerializable + { + /// BillingAccount ID + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"BillingAccount ID", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + string BillingAccountId { get; set; } + /// Billing Period Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Billing Period Name.", + SerializedName = @"billingPeriodName", + PossibleTypes = new [] { typeof(string) })] + string BillingPeriodName { get; set; } + /// Azure Billing Profile ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Billing Profile ID.", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileId { get; set; } + /// Budget Name. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Budget Name.", + SerializedName = @"budgetName", + PossibleTypes = new [] { typeof(string) })] + string BudgetName { get; set; } + /// Customer ID + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Customer ID", + SerializedName = @"customerId", + PossibleTypes = new [] { typeof(string) })] + string CustomerId { get; set; } + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identity path", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Azure Management Group ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Management Group ID.", + SerializedName = @"managementGroupId", + PossibleTypes = new [] { typeof(string) })] + string ManagementGroupId { get; set; } + /// Id of the reservation + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id of the reservation", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + string ReservationId { get; set; } + /// Order Id of the reservation + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + string ReservationOrderId { get; set; } + /// + /// The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for BillingProfile scope (modern). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). ", + SerializedName = @"resourceScope", + PossibleTypes = new [] { typeof(string) })] + string ResourceScope { 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 + /// and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, + /// billing account, department, enrollment account and management group, you can also add billing period to the scope using + /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope + /// use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + /// 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.Consumption.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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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; } + /// Azure Subscription ID. + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + } + internal partial interface IConsumptionIdentityInternal + + { + /// BillingAccount ID + string BillingAccountId { get; set; } + /// Billing Period Name. + string BillingPeriodName { get; set; } + /// Azure Billing Profile ID. + string BillingProfileId { get; set; } + /// Budget Name. + string BudgetName { get; set; } + /// Customer ID + string CustomerId { get; set; } + /// Resource identity path + string Id { get; set; } + /// Azure Management Group ID. + string ManagementGroupId { get; set; } + /// Id of the reservation + string ReservationId { get; set; } + /// Order Id of the reservation + string ReservationOrderId { get; set; } + /// + /// The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for BillingProfile scope (modern). + /// + string ResourceScope { 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 + /// and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, + /// billing account, department, enrollment account and management group, you can also add billing period to the scope using + /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope + /// use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + /// 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; } + /// Azure Subscription ID. + string SubscriptionId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Models/ConsumptionIdentity.json.cs b/swaggerci/consumption/generated/api/Models/ConsumptionIdentity.json.cs new file mode 100644 index 000000000000..f2e58d6eaa4a --- /dev/null +++ b/swaggerci/consumption/generated/api/Models/ConsumptionIdentity.json.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + + public partial class ConsumptionIdentity + { + + /// + /// 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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject instance to deserialize from. + internal ConsumptionIdentity(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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;} + {_budgetName = If( json?.PropertyT("budgetName"), out var __jsonBudgetName) ? (string)__jsonBudgetName : (string)BudgetName;} + {_billingAccountId = If( json?.PropertyT("billingAccountId"), out var __jsonBillingAccountId) ? (string)__jsonBillingAccountId : (string)BillingAccountId;} + {_billingPeriodName = If( json?.PropertyT("billingPeriodName"), out var __jsonBillingPeriodName) ? (string)__jsonBillingPeriodName : (string)BillingPeriodName;} + {_reservationOrderId = If( json?.PropertyT("reservationOrderId"), out var __jsonReservationOrderId) ? (string)__jsonReservationOrderId : (string)ReservationOrderId;} + {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)ReservationId;} + {_resourceScope = If( json?.PropertyT("resourceScope"), out var __jsonResourceScope) ? (string)__jsonResourceScope : (string)ResourceScope;} + {_billingProfileId = If( json?.PropertyT("billingProfileId"), out var __jsonBillingProfileId) ? (string)__jsonBillingProfileId : (string)BillingProfileId;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_managementGroupId = If( json?.PropertyT("managementGroupId"), out var __jsonManagementGroupId) ? (string)__jsonManagementGroupId : (string)ManagementGroupId;} + {_customerId = If( json?.PropertyT("customerId"), out var __jsonCustomerId) ? (string)__jsonCustomerId : (string)CustomerId;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject json ? new ConsumptionIdentity(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.Consumption.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + AddIf( null != (((object)this._budgetName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._budgetName.ToString()) : null, "budgetName" ,container.Add ); + AddIf( null != (((object)this._billingAccountId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingAccountId.ToString()) : null, "billingAccountId" ,container.Add ); + AddIf( null != (((object)this._billingPeriodName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingPeriodName.ToString()) : null, "billingPeriodName" ,container.Add ); + AddIf( null != (((object)this._reservationOrderId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationOrderId.ToString()) : null, "reservationOrderId" ,container.Add ); + AddIf( null != (((object)this._reservationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._reservationId.ToString()) : null, "reservationId" ,container.Add ); + AddIf( null != (((object)this._resourceScope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._resourceScope.ToString()) : null, "resourceScope" ,container.Add ); + AddIf( null != (((object)this._billingProfileId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._billingProfileId.ToString()) : null, "billingProfileId" ,container.Add ); + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._managementGroupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._managementGroupId.ToString()) : null, "managementGroupId" ,container.Add ); + AddIf( null != (((object)this._customerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonString(this._customerId.ToString()) : null, "customerId" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/api/Support/BillingFrequency.Completer.cs b/swaggerci/consumption/generated/api/Support/BillingFrequency.Completer.cs new file mode 100644 index 000000000000..b82fb7817d24 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/BillingFrequency.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.Consumption.Support +{ + + /// The billing frequency. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequencyTypeConverter))] + public partial struct BillingFrequency : + 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) || "Month".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Month'", "Month", global::System.Management.Automation.CompletionResultType.ParameterValue, "Month"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Quarter".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Quarter'", "Quarter", global::System.Management.Automation.CompletionResultType.ParameterValue, "Quarter"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Year".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Year'", "Year", global::System.Management.Automation.CompletionResultType.ParameterValue, "Year"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/BillingFrequency.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/BillingFrequency.TypeConverter.cs new file mode 100644 index 000000000000..fb980ded6325 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/BillingFrequency.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.Consumption.Support +{ + + /// The billing frequency. + public partial class BillingFrequencyTypeConverter : + 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) => BillingFrequency.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/consumption/generated/api/Support/BillingFrequency.cs b/swaggerci/consumption/generated/api/Support/BillingFrequency.cs new file mode 100644 index 000000000000..d57c9cb5ceb6 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/BillingFrequency.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.Consumption.Support +{ + + /// The billing frequency. + public partial struct BillingFrequency : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency Month = @"Month"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency Quarter = @"Quarter"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency Year = @"Year"; + + /// 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 BillingFrequency(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BillingFrequency + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BillingFrequency(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BillingFrequency + /// 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.Consumption.Support.BillingFrequency e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BillingFrequency (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 BillingFrequency && Equals((BillingFrequency)obj); + } + + /// Returns hashCode for enum BillingFrequency + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BillingFrequency + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BillingFrequency + /// the value to convert to an instance of . + + public static implicit operator BillingFrequency(string value) + { + return new BillingFrequency(value); + } + + /// Implicit operator to convert BillingFrequency to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency e) + { + return e._value; + } + + /// Overriding != operator for enum BillingFrequency + /// 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.Consumption.Support.BillingFrequency e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BillingFrequency + /// 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.Consumption.Support.BillingFrequency e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.BillingFrequency e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/ChargeSummaryKind.Completer.cs b/swaggerci/consumption/generated/api/Support/ChargeSummaryKind.Completer.cs new file mode 100644 index 000000000000..5e9ccf3b580d --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/ChargeSummaryKind.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.Consumption.Support +{ + + /// Specifies the kind of charge summary. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKindTypeConverter))] + public partial struct ChargeSummaryKind : + 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) || "legacy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'legacy'", "legacy", global::System.Management.Automation.CompletionResultType.ParameterValue, "legacy"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "modern".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'modern'", "modern", global::System.Management.Automation.CompletionResultType.ParameterValue, "modern"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/ChargeSummaryKind.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/ChargeSummaryKind.TypeConverter.cs new file mode 100644 index 000000000000..abe72be357c7 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/ChargeSummaryKind.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.Consumption.Support +{ + + /// Specifies the kind of charge summary. + public partial class ChargeSummaryKindTypeConverter : + 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) => ChargeSummaryKind.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/consumption/generated/api/Support/ChargeSummaryKind.cs b/swaggerci/consumption/generated/api/Support/ChargeSummaryKind.cs new file mode 100644 index 000000000000..a8b7eb004a44 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/ChargeSummaryKind.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.Consumption.Support +{ + + /// Specifies the kind of charge summary. + public partial struct ChargeSummaryKind : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind Legacy = @"legacy"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind Modern = @"modern"; + + /// 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 ChargeSummaryKind(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ChargeSummaryKind + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ChargeSummaryKind(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ChargeSummaryKind + /// 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.Consumption.Support.ChargeSummaryKind e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ChargeSummaryKind (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 ChargeSummaryKind && Equals((ChargeSummaryKind)obj); + } + + /// Returns hashCode for enum ChargeSummaryKind + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ChargeSummaryKind + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ChargeSummaryKind + /// the value to convert to an instance of . + + public static implicit operator ChargeSummaryKind(string value) + { + return new ChargeSummaryKind(value); + } + + /// Implicit operator to convert ChargeSummaryKind to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind e) + { + return e._value; + } + + /// Overriding != operator for enum ChargeSummaryKind + /// 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.Consumption.Support.ChargeSummaryKind e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ChargeSummaryKind + /// 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.Consumption.Support.ChargeSummaryKind e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ChargeSummaryKind e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/CultureCode.Completer.cs b/swaggerci/consumption/generated/api/Support/CultureCode.Completer.cs new file mode 100644 index 000000000000..5d985824ef8c --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/CultureCode.Completer.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.Consumption.Support +{ + + /// Language in which the recipient will receive the notification + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCodeTypeConverter))] + public partial struct CultureCode : + 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) || "en-us".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'en-us'", "en-us", global::System.Management.Automation.CompletionResultType.ParameterValue, "en-us"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ja-jp".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ja-jp'", "ja-jp", global::System.Management.Automation.CompletionResultType.ParameterValue, "ja-jp"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "zh-cn".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'zh-cn'", "zh-cn", global::System.Management.Automation.CompletionResultType.ParameterValue, "zh-cn"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "de-de".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'de-de'", "de-de", global::System.Management.Automation.CompletionResultType.ParameterValue, "de-de"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "es-es".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'es-es'", "es-es", global::System.Management.Automation.CompletionResultType.ParameterValue, "es-es"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "fr-fr".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'fr-fr'", "fr-fr", global::System.Management.Automation.CompletionResultType.ParameterValue, "fr-fr"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "it-it".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'it-it'", "it-it", global::System.Management.Automation.CompletionResultType.ParameterValue, "it-it"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ko-kr".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ko-kr'", "ko-kr", global::System.Management.Automation.CompletionResultType.ParameterValue, "ko-kr"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "pt-br".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'pt-br'", "pt-br", global::System.Management.Automation.CompletionResultType.ParameterValue, "pt-br"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ru-ru".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ru-ru'", "ru-ru", global::System.Management.Automation.CompletionResultType.ParameterValue, "ru-ru"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "zh-tw".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'zh-tw'", "zh-tw", global::System.Management.Automation.CompletionResultType.ParameterValue, "zh-tw"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "cs-cz".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'cs-cz'", "cs-cz", global::System.Management.Automation.CompletionResultType.ParameterValue, "cs-cz"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "pl-pl".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'pl-pl'", "pl-pl", global::System.Management.Automation.CompletionResultType.ParameterValue, "pl-pl"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "tr-tr".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'tr-tr'", "tr-tr", global::System.Management.Automation.CompletionResultType.ParameterValue, "tr-tr"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "da-dk".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'da-dk'", "da-dk", global::System.Management.Automation.CompletionResultType.ParameterValue, "da-dk"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "en-gb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'en-gb'", "en-gb", global::System.Management.Automation.CompletionResultType.ParameterValue, "en-gb"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "hu-hu".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'hu-hu'", "hu-hu", global::System.Management.Automation.CompletionResultType.ParameterValue, "hu-hu"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "nb-no".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'nb-no'", "nb-no", global::System.Management.Automation.CompletionResultType.ParameterValue, "nb-no"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "nl-nl".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'nl-nl'", "nl-nl", global::System.Management.Automation.CompletionResultType.ParameterValue, "nl-nl"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "pt-pt".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'pt-pt'", "pt-pt", global::System.Management.Automation.CompletionResultType.ParameterValue, "pt-pt"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "sv-se".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'sv-se'", "sv-se", global::System.Management.Automation.CompletionResultType.ParameterValue, "sv-se"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/CultureCode.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/CultureCode.TypeConverter.cs new file mode 100644 index 000000000000..1e0d0e9cfec9 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/CultureCode.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.Consumption.Support +{ + + /// Language in which the recipient will receive the notification + public partial class CultureCodeTypeConverter : + 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) => CultureCode.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/consumption/generated/api/Support/CultureCode.cs b/swaggerci/consumption/generated/api/Support/CultureCode.cs new file mode 100644 index 000000000000..84e4aee10e3b --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/CultureCode.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.Consumption.Support +{ + + /// Language in which the recipient will receive the notification + public partial struct CultureCode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode CsCz = @"cs-cz"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode DaDk = @"da-dk"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode De = @"de-de"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode EnGb = @"en-gb"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode EnUs = @"en-us"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode Es = @"es-es"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode Fr = @"fr-fr"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode Hu = @"hu-hu"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode It = @"it-it"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode JaJp = @"ja-jp"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode KoKr = @"ko-kr"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode NbNo = @"nb-no"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode Nl = @"nl-nl"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode Pl = @"pl-pl"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode Pt = @"pt-pt"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode PtBr = @"pt-br"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode Ru = @"ru-ru"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode SvSe = @"sv-se"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode Tr = @"tr-tr"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode ZhCn = @"zh-cn"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode ZhTw = @"zh-tw"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to CultureCode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CultureCode(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private CultureCode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type CultureCode + /// 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.Consumption.Support.CultureCode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CultureCode (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 CultureCode && Equals((CultureCode)obj); + } + + /// Returns hashCode for enum CultureCode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CultureCode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CultureCode + /// the value to convert to an instance of . + + public static implicit operator CultureCode(string value) + { + return new CultureCode(value); + } + + /// Implicit operator to convert CultureCode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode e) + { + return e._value; + } + + /// Overriding != operator for enum CultureCode + /// 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.Consumption.Support.CultureCode e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CultureCode + /// 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.Consumption.Support.CultureCode e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.CultureCode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/Datagrain.Completer.cs b/swaggerci/consumption/generated/api/Support/Datagrain.Completer.cs new file mode 100644 index 000000000000..8687e36fa492 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Datagrain.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.Consumption.Support +{ + + /// Argument completer implementation for Datagrain. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.DatagrainTypeConverter))] + public partial struct Datagrain : + 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/consumption/generated/api/Support/Datagrain.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/Datagrain.TypeConverter.cs new file mode 100644 index 000000000000..ca4ab2f9b5b9 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Datagrain.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.Consumption.Support +{ + + /// TypeConverter implementation for Datagrain. + public partial class DatagrainTypeConverter : + 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) => Datagrain.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/consumption/generated/api/Support/Datagrain.cs b/swaggerci/consumption/generated/api/Support/Datagrain.cs new file mode 100644 index 000000000000..11d432efe614 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Datagrain.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support +{ + + public partial struct Datagrain : + System.IEquatable + { + /// Daily grain of data + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain Daily = @"daily"; + + /// Monthly grain of data + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain Monthly = @"monthly"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Datagrain + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Datagrain(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Datagrain(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type Datagrain + /// 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.Consumption.Support.Datagrain e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Datagrain (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 Datagrain && Equals((Datagrain)obj); + } + + /// Returns hashCode for enum Datagrain + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for Datagrain + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Datagrain + /// the value to convert to an instance of . + + public static implicit operator Datagrain(string value) + { + return new Datagrain(value); + } + + /// Implicit operator to convert Datagrain to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain e) + { + return e._value; + } + + /// Overriding != operator for enum Datagrain + /// 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.Consumption.Support.Datagrain e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Datagrain + /// 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.Consumption.Support.Datagrain e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/EventType.Completer.cs b/swaggerci/consumption/generated/api/Support/EventType.Completer.cs new file mode 100644 index 000000000000..8acaf05c95f1 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/EventType.Completer.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support +{ + + /// Identifies the type of the event. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventTypeTypeConverter))] + public partial struct EventType : + 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) || "SettledCharges".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SettledCharges'", "SettledCharges", global::System.Management.Automation.CompletionResultType.ParameterValue, "SettledCharges"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingCharges".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PendingCharges'", "PendingCharges", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingCharges"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingAdjustments".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PendingAdjustments'", "PendingAdjustments", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingAdjustments"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingNewCredit".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PendingNewCredit'", "PendingNewCredit", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingNewCredit"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingExpiredCredit".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PendingExpiredCredit'", "PendingExpiredCredit", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingExpiredCredit"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UnKnown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UnKnown'", "UnKnown", global::System.Management.Automation.CompletionResultType.ParameterValue, "UnKnown"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NewCredit".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NewCredit'", "NewCredit", global::System.Management.Automation.CompletionResultType.ParameterValue, "NewCredit"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CreditExpired".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CreditExpired'", "CreditExpired", global::System.Management.Automation.CompletionResultType.ParameterValue, "CreditExpired"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/EventType.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/EventType.TypeConverter.cs new file mode 100644 index 000000000000..a59089362187 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/EventType.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.Consumption.Support +{ + + /// Identifies the type of the event. + public partial class EventTypeTypeConverter : + 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) => EventType.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/consumption/generated/api/Support/EventType.cs b/swaggerci/consumption/generated/api/Support/EventType.cs new file mode 100644 index 000000000000..bcf59e9938cd --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/EventType.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.Consumption.Support +{ + + /// Identifies the type of the event. + public partial struct EventType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType CreditExpired = @"CreditExpired"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType NewCredit = @"NewCredit"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType PendingAdjustments = @"PendingAdjustments"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType PendingCharges = @"PendingCharges"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType PendingExpiredCredit = @"PendingExpiredCredit"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType PendingNewCredit = @"PendingNewCredit"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType SettledCharges = @"SettledCharges"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType UnKnown = @"UnKnown"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to EventType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EventType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type EventType + /// 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.Consumption.Support.EventType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type EventType (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 EventType && Equals((EventType)obj); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private EventType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum EventType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EventType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EventType + /// the value to convert to an instance of . + + public static implicit operator EventType(string value) + { + return new EventType(value); + } + + /// Implicit operator to convert EventType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType e) + { + return e._value; + } + + /// Overriding != operator for enum EventType + /// 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.Consumption.Support.EventType e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EventType + /// 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.Consumption.Support.EventType e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.EventType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/LookBackPeriod.Completer.cs b/swaggerci/consumption/generated/api/Support/LookBackPeriod.Completer.cs new file mode 100644 index 000000000000..7adfeab6a002 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/LookBackPeriod.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.Consumption.Support +{ + + /// Argument completer implementation for LookBackPeriod. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriodTypeConverter))] + public partial struct LookBackPeriod : + 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) || "Last7Days".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Last7Days'", "Last7Days", global::System.Management.Automation.CompletionResultType.ParameterValue, "Last7Days"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Last30Days".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Last30Days'", "Last30Days", global::System.Management.Automation.CompletionResultType.ParameterValue, "Last30Days"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Last60Days".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Last60Days'", "Last60Days", global::System.Management.Automation.CompletionResultType.ParameterValue, "Last60Days"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/LookBackPeriod.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/LookBackPeriod.TypeConverter.cs new file mode 100644 index 000000000000..0f14776ec247 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/LookBackPeriod.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.Consumption.Support +{ + + /// TypeConverter implementation for LookBackPeriod. + public partial class LookBackPeriodTypeConverter : + 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) => LookBackPeriod.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/consumption/generated/api/Support/LookBackPeriod.cs b/swaggerci/consumption/generated/api/Support/LookBackPeriod.cs new file mode 100644 index 000000000000..dd5dc398aadc --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/LookBackPeriod.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.Consumption.Support +{ + + public partial struct LookBackPeriod : + System.IEquatable + { + /// Use 30 days of data for recommendations + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod Last30Days = @"Last30Days"; + + /// Use 60 days of data for recommendations + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod Last60Days = @"Last60Days"; + + /// Use 7 days of data for recommendations + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod Last7Days = @"Last7Days"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LookBackPeriod + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LookBackPeriod(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LookBackPeriod + /// 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.Consumption.Support.LookBackPeriod e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LookBackPeriod (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 LookBackPeriod && Equals((LookBackPeriod)obj); + } + + /// Returns hashCode for enum LookBackPeriod + /// 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 LookBackPeriod(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LookBackPeriod + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LookBackPeriod + /// the value to convert to an instance of . + + public static implicit operator LookBackPeriod(string value) + { + return new LookBackPeriod(value); + } + + /// Implicit operator to convert LookBackPeriod to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod e) + { + return e._value; + } + + /// Overriding != operator for enum LookBackPeriod + /// 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.Consumption.Support.LookBackPeriod e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LookBackPeriod + /// 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.Consumption.Support.LookBackPeriod e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/LotSource.Completer.cs b/swaggerci/consumption/generated/api/Support/LotSource.Completer.cs new file mode 100644 index 000000000000..40443a19168c --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/LotSource.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.Consumption.Support +{ + + /// The source of the lot. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSourceTypeConverter))] + public partial struct LotSource : + 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) || "PurchasedCredit".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PurchasedCredit'", "PurchasedCredit", global::System.Management.Automation.CompletionResultType.ParameterValue, "PurchasedCredit"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PromotionalCredit".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PromotionalCredit'", "PromotionalCredit", global::System.Management.Automation.CompletionResultType.ParameterValue, "PromotionalCredit"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConsumptionCommitment".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ConsumptionCommitment'", "ConsumptionCommitment", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConsumptionCommitment"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/LotSource.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/LotSource.TypeConverter.cs new file mode 100644 index 000000000000..313a9cc269d2 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/LotSource.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.Consumption.Support +{ + + /// The source of the lot. + public partial class LotSourceTypeConverter : + 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) => LotSource.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/consumption/generated/api/Support/LotSource.cs b/swaggerci/consumption/generated/api/Support/LotSource.cs new file mode 100644 index 000000000000..a8c52b7d6b93 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/LotSource.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.Consumption.Support +{ + + /// The source of the lot. + public partial struct LotSource : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource ConsumptionCommitment = @"ConsumptionCommitment"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource PromotionalCredit = @"PromotionalCredit"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource PurchasedCredit = @"PurchasedCredit"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LotSource + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LotSource(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LotSource + /// 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.Consumption.Support.LotSource e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LotSource (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 LotSource && Equals((LotSource)obj); + } + + /// Returns hashCode for enum LotSource + /// 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 LotSource(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LotSource + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LotSource + /// the value to convert to an instance of . + + public static implicit operator LotSource(string value) + { + return new LotSource(value); + } + + /// Implicit operator to convert LotSource to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource e) + { + return e._value; + } + + /// Overriding != operator for enum LotSource + /// 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.Consumption.Support.LotSource e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LotSource + /// 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.Consumption.Support.LotSource e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LotSource e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/Metrictype.Completer.cs b/swaggerci/consumption/generated/api/Support/Metrictype.Completer.cs new file mode 100644 index 000000000000..a287ba457e42 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Support +{ + + /// Argument completer implementation for Metrictype. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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) || "usage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'usage'", "usage", global::System.Management.Automation.CompletionResultType.ParameterValue, "usage"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/Metrictype.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/Metrictype.TypeConverter.cs new file mode 100644 index 000000000000..6e30e75e921d --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Support +{ + + /// TypeConverter implementation for Metrictype. + 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/consumption/generated/api/Support/Metrictype.cs b/swaggerci/consumption/generated/api/Support/Metrictype.cs new file mode 100644 index 000000000000..757c2c328bbf --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Metrictype.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.Consumption.Support +{ + + public partial struct Metrictype : + System.IEquatable + { + /// Actual cost data. + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype Actualcost = @"actualcost"; + + /// Amortized cost data. + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype Amortizedcost = @"amortizedcost"; + + /// Usage data. + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype Usage = @"usage"; + + /// 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.Consumption.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.Consumption.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.Consumption.Support.Metrictype e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Support.Metrictype e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/OperatorType.Completer.cs b/swaggerci/consumption/generated/api/Support/OperatorType.Completer.cs new file mode 100644 index 000000000000..c3c8fec3b4b4 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/OperatorType.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.Consumption.Support +{ + + /// The comparison operator. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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) || "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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/OperatorType.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/OperatorType.TypeConverter.cs new file mode 100644 index 000000000000..98e6923d5f25 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Support +{ + + /// The comparison operator. + 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/consumption/generated/api/Support/OperatorType.cs b/swaggerci/consumption/generated/api/Support/OperatorType.cs new file mode 100644 index 000000000000..dd904d6ccb36 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/OperatorType.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.Consumption.Support +{ + + /// The comparison operator. + public partial struct OperatorType : + System.IEquatable + { + /// + /// Alert will be triggered if the evaluated cost is the same as threshold value. Note: It’s not recommended to use this OperatorType + /// as there’s low chance of cost being exactly the same as threshold value, leading to missing of your alert. This OperatorType + /// will be deprecated in future. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType EqualTo = @"EqualTo"; + + /// + /// Alert will be triggered if the evaluated cost is greater than the threshold value. Note: This is the recommended OperatorType + /// while configuring Budget Alert. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType GreaterThan = @"GreaterThan"; + + /// + /// Alert will be triggered if the evaluated cost is greater than or equal to the threshold value. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType GreaterThanOrEqualTo = @"GreaterThanOrEqualTo"; + + /// 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.Consumption.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.Consumption.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.Consumption.Support.OperatorType e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Support.OperatorType e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.OperatorType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/PricingModelType.Completer.cs b/swaggerci/consumption/generated/api/Support/PricingModelType.Completer.cs new file mode 100644 index 000000000000..22dfe87f4560 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/PricingModelType.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.Consumption.Support +{ + + /// Identifier that indicates how the meter is priced. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelTypeTypeConverter))] + public partial struct PricingModelType : + 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) || "On Demand".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'On Demand'", "On Demand", global::System.Management.Automation.CompletionResultType.ParameterValue, "On Demand"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Reservation".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Reservation'", "Reservation", global::System.Management.Automation.CompletionResultType.ParameterValue, "Reservation"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Spot".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Spot'", "Spot", global::System.Management.Automation.CompletionResultType.ParameterValue, "Spot"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/PricingModelType.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/PricingModelType.TypeConverter.cs new file mode 100644 index 000000000000..d75f9cffa429 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/PricingModelType.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.Consumption.Support +{ + + /// Identifier that indicates how the meter is priced. + public partial class PricingModelTypeTypeConverter : + 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) => PricingModelType.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/consumption/generated/api/Support/PricingModelType.cs b/swaggerci/consumption/generated/api/Support/PricingModelType.cs new file mode 100644 index 000000000000..f6be16d07771 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/PricingModelType.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.Consumption.Support +{ + + /// Identifier that indicates how the meter is priced. + public partial struct PricingModelType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType OnDemand = @"On Demand"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType Reservation = @"Reservation"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType Spot = @"Spot"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PricingModelType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PricingModelType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PricingModelType + /// 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.Consumption.Support.PricingModelType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PricingModelType (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 PricingModelType && Equals((PricingModelType)obj); + } + + /// Returns hashCode for enum PricingModelType + /// 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 PricingModelType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PricingModelType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PricingModelType + /// the value to convert to an instance of . + + public static implicit operator PricingModelType(string value) + { + return new PricingModelType(value); + } + + /// Implicit operator to convert PricingModelType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType e) + { + return e._value; + } + + /// Overriding != operator for enum PricingModelType + /// 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.Consumption.Support.PricingModelType e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PricingModelType + /// 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.Consumption.Support.PricingModelType e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.PricingModelType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/ReservationRecommendationKind.Completer.cs b/swaggerci/consumption/generated/api/Support/ReservationRecommendationKind.Completer.cs new file mode 100644 index 000000000000..7ddbfbb4c69a --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/ReservationRecommendationKind.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.Consumption.Support +{ + + /// Specifies the kind of reservation recommendation. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKindTypeConverter))] + public partial struct ReservationRecommendationKind : + 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) || "legacy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'legacy'", "legacy", global::System.Management.Automation.CompletionResultType.ParameterValue, "legacy"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "modern".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'modern'", "modern", global::System.Management.Automation.CompletionResultType.ParameterValue, "modern"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/ReservationRecommendationKind.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/ReservationRecommendationKind.TypeConverter.cs new file mode 100644 index 000000000000..af3e7369be3b --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/ReservationRecommendationKind.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.Consumption.Support +{ + + /// Specifies the kind of reservation recommendation. + public partial class ReservationRecommendationKindTypeConverter : + 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) => ReservationRecommendationKind.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/consumption/generated/api/Support/ReservationRecommendationKind.cs b/swaggerci/consumption/generated/api/Support/ReservationRecommendationKind.cs new file mode 100644 index 000000000000..79bdd01edf59 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/ReservationRecommendationKind.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.Consumption.Support +{ + + /// Specifies the kind of reservation recommendation. + public partial struct ReservationRecommendationKind : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind Legacy = @"legacy"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind Modern = @"modern"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to ReservationRecommendationKind + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ReservationRecommendationKind(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ReservationRecommendationKind + /// 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.Consumption.Support.ReservationRecommendationKind e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type ReservationRecommendationKind (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 ReservationRecommendationKind && Equals((ReservationRecommendationKind)obj); + } + + /// Returns hashCode for enum ReservationRecommendationKind + /// 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 ReservationRecommendationKind(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ReservationRecommendationKind + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ReservationRecommendationKind + /// the value to convert to an instance of . + + public static implicit operator ReservationRecommendationKind(string value) + { + return new ReservationRecommendationKind(value); + } + + /// Implicit operator to convert ReservationRecommendationKind to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind e) + { + return e._value; + } + + /// Overriding != operator for enum ReservationRecommendationKind + /// 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.Consumption.Support.ReservationRecommendationKind e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ReservationRecommendationKind + /// 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.Consumption.Support.ReservationRecommendationKind e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ReservationRecommendationKind e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/Scope.Completer.cs b/swaggerci/consumption/generated/api/Support/Scope.Completer.cs new file mode 100644 index 000000000000..30ac88964893 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Scope.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.Consumption.Support +{ + + /// Argument completer implementation for Scope. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ScopeTypeConverter))] + public partial struct Scope : + 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) || "Single".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Single'", "Single", global::System.Management.Automation.CompletionResultType.ParameterValue, "Single"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Shared".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Shared'", "Shared", global::System.Management.Automation.CompletionResultType.ParameterValue, "Shared"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/Scope.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/Scope.TypeConverter.cs new file mode 100644 index 000000000000..d4c202a41155 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Scope.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.Consumption.Support +{ + + /// TypeConverter implementation for Scope. + public partial class ScopeTypeConverter : + 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) => Scope.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/consumption/generated/api/Support/Scope.cs b/swaggerci/consumption/generated/api/Support/Scope.cs new file mode 100644 index 000000000000..5fe2909d94b0 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Scope.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.Consumption.Support +{ + + public partial struct Scope : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope Shared = @"Shared"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope Single = @"Single"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Scope + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Scope(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Scope + /// 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.Consumption.Support.Scope e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Scope (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 Scope && Equals((Scope)obj); + } + + /// Returns hashCode for enum Scope + /// 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 Scope(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Scope + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Scope + /// the value to convert to an instance of . + + public static implicit operator Scope(string value) + { + return new Scope(value); + } + + /// Implicit operator to convert Scope to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope e) + { + return e._value; + } + + /// Overriding != operator for enum Scope + /// 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.Consumption.Support.Scope e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Scope + /// 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.Consumption.Support.Scope e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/Status.Completer.cs b/swaggerci/consumption/generated/api/Support/Status.Completer.cs new file mode 100644 index 000000000000..10155c9a81e5 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Status.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.Consumption.Support +{ + + /// The status of the lot. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.StatusTypeConverter))] + public partial struct Status : + 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) || "Inactive".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Inactive'", "Inactive", global::System.Management.Automation.CompletionResultType.ParameterValue, "Inactive"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Expired".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Expired'", "Expired", global::System.Management.Automation.CompletionResultType.ParameterValue, "Expired"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Complete".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Complete'", "Complete", global::System.Management.Automation.CompletionResultType.ParameterValue, "Complete"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/Status.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/Status.TypeConverter.cs new file mode 100644 index 000000000000..0855126b8005 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Status.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.Consumption.Support +{ + + /// The status of the lot. + 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) => 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) => Status.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/consumption/generated/api/Support/Status.cs b/swaggerci/consumption/generated/api/Support/Status.cs new file mode 100644 index 000000000000..5d742f0bbd87 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Status.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.Consumption.Support +{ + + /// The status of the lot. + public partial struct Status : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status Active = @"Active"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status Complete = @"Complete"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status Expired = @"Expired"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status Inactive = @"Inactive"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status None = @"None"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Status + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Status(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Status + /// 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.Consumption.Support.Status e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Status (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 Status && Equals((Status)obj); + } + + /// Returns hashCode for enum Status + /// 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 Status(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Status + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Status + /// the value to convert to an instance of . + + public static implicit operator Status(string value) + { + return new Status(value); + } + + /// Implicit operator to convert Status to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status e) + { + return e._value; + } + + /// Overriding != operator for enum Status + /// 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.Consumption.Support.Status e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Status + /// 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.Consumption.Support.Status e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Status e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/Term.Completer.cs b/swaggerci/consumption/generated/api/Support/Term.Completer.cs new file mode 100644 index 000000000000..5ffa52d00419 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Term.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.Consumption.Support +{ + + /// Argument completer implementation for Term. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TermTypeConverter))] + public partial struct Term : + 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) || "P1Y".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'P1Y'", "P1Y", global::System.Management.Automation.CompletionResultType.ParameterValue, "P1Y"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "P3Y".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'P3Y'", "P3Y", global::System.Management.Automation.CompletionResultType.ParameterValue, "P3Y"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/Term.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/Term.TypeConverter.cs new file mode 100644 index 000000000000..d522e0a3508f --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Term.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.Consumption.Support +{ + + /// TypeConverter implementation for Term. + public partial class TermTypeConverter : + 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) => Term.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/consumption/generated/api/Support/Term.cs b/swaggerci/consumption/generated/api/Support/Term.cs new file mode 100644 index 000000000000..6b8fba5310b4 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/Term.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support +{ + + public partial struct Term : + System.IEquatable + { + /// 1 year reservation term + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term P1Y = @"P1Y"; + + /// 3 year reservation term + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term P3Y = @"P3Y"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Term + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Term(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Term + /// 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.Consumption.Support.Term e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Term (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 Term && Equals((Term)obj); + } + + /// Returns hashCode for enum Term + /// 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 Term(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Term + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Term + /// the value to convert to an instance of . + + public static implicit operator Term(string value) + { + return new Term(value); + } + + /// Implicit operator to convert Term to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term e) + { + return e._value; + } + + /// Overriding != operator for enum Term + /// 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.Consumption.Support.Term e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Term + /// 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.Consumption.Support.Term e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/ThresholdType.Completer.cs b/swaggerci/consumption/generated/api/Support/ThresholdType.Completer.cs new file mode 100644 index 000000000000..cfa9eda3ac6e --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/ThresholdType.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.Consumption.Support +{ + + /// The type of threshold + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdTypeTypeConverter))] + public partial struct ThresholdType : + 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) || "Actual".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Actual'", "Actual", global::System.Management.Automation.CompletionResultType.ParameterValue, "Actual"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Forecasted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Forecasted'", "Forecasted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Forecasted"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/ThresholdType.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/ThresholdType.TypeConverter.cs new file mode 100644 index 000000000000..b10dbc5b448d --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/ThresholdType.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.Consumption.Support +{ + + /// The type of threshold + public partial class ThresholdTypeTypeConverter : + 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) => ThresholdType.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/consumption/generated/api/Support/ThresholdType.cs b/swaggerci/consumption/generated/api/Support/ThresholdType.cs new file mode 100644 index 000000000000..b3b46fe7f459 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/ThresholdType.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support +{ + + /// The type of threshold + public partial struct ThresholdType : + System.IEquatable + { + /// + /// Actual costs budget alerts notify when the actual accrued cost exceeds the allocated budget . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType Actual = @"Actual"; + + /// + /// Forecasted costs budget alerts provide advanced notification that your spending trends are likely to exceed your allocated + /// budget, as it relies on forecasted cost predictions. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType Forecasted = @"Forecasted"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ThresholdType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ThresholdType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ThresholdType + /// 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.Consumption.Support.ThresholdType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ThresholdType (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 ThresholdType && Equals((ThresholdType)obj); + } + + /// Returns hashCode for enum ThresholdType + /// 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 ThresholdType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ThresholdType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ThresholdType + /// the value to convert to an instance of . + + public static implicit operator ThresholdType(string value) + { + return new ThresholdType(value); + } + + /// Implicit operator to convert ThresholdType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType e) + { + return e._value; + } + + /// Overriding != operator for enum ThresholdType + /// 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.Consumption.Support.ThresholdType e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ThresholdType + /// 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.Consumption.Support.ThresholdType e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.ThresholdType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/TimeGrainType.Completer.cs b/swaggerci/consumption/generated/api/Support/TimeGrainType.Completer.cs new file mode 100644 index 000000000000..4f099385a5f2 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/TimeGrainType.Completer.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support +{ + + /// + /// The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, + /// and BillingAnnual are only supported by WD customers + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainTypeTypeConverter))] + public partial struct TimeGrainType : + 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) || "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/consumption/generated/api/Support/TimeGrainType.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/TimeGrainType.TypeConverter.cs new file mode 100644 index 000000000000..c389708bc4dc --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/TimeGrainType.TypeConverter.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support +{ + + /// + /// The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, + /// and BillingAnnual are only supported by WD customers + /// + public partial class TimeGrainTypeTypeConverter : + 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) => TimeGrainType.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/consumption/generated/api/Support/TimeGrainType.cs b/swaggerci/consumption/generated/api/Support/TimeGrainType.cs new file mode 100644 index 000000000000..db226398d1ee --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/TimeGrainType.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.Consumption.Support +{ + + /// + /// The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, + /// and BillingAnnual are only supported by WD customers + /// + public partial struct TimeGrainType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType Annually = @"Annually"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType BillingAnnual = @"BillingAnnual"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType BillingMonth = @"BillingMonth"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType BillingQuarter = @"BillingQuarter"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType Monthly = @"Monthly"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType Quarterly = @"Quarterly"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to TimeGrainType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TimeGrainType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TimeGrainType + /// 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.Consumption.Support.TimeGrainType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type TimeGrainType (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 TimeGrainType && Equals((TimeGrainType)obj); + } + + /// Returns hashCode for enum TimeGrainType + /// 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 TimeGrainType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for TimeGrainType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to TimeGrainType + /// the value to convert to an instance of . + + public static implicit operator TimeGrainType(string value) + { + return new TimeGrainType(value); + } + + /// Implicit operator to convert TimeGrainType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType e) + { + return e._value; + } + + /// Overriding != operator for enum TimeGrainType + /// 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.Consumption.Support.TimeGrainType e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TimeGrainType + /// 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.Consumption.Support.TimeGrainType e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/UsageDetailsKind.Completer.cs b/swaggerci/consumption/generated/api/Support/UsageDetailsKind.Completer.cs new file mode 100644 index 000000000000..8c7f8d6e558f --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/UsageDetailsKind.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.Consumption.Support +{ + + /// Specifies the kind of usage details. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKindTypeConverter))] + public partial struct UsageDetailsKind : + 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) || "legacy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'legacy'", "legacy", global::System.Management.Automation.CompletionResultType.ParameterValue, "legacy"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "modern".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'modern'", "modern", global::System.Management.Automation.CompletionResultType.ParameterValue, "modern"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/api/Support/UsageDetailsKind.TypeConverter.cs b/swaggerci/consumption/generated/api/Support/UsageDetailsKind.TypeConverter.cs new file mode 100644 index 000000000000..06925347ae3b --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/UsageDetailsKind.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.Consumption.Support +{ + + /// Specifies the kind of usage details. + public partial class UsageDetailsKindTypeConverter : + 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) => UsageDetailsKind.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/consumption/generated/api/Support/UsageDetailsKind.cs b/swaggerci/consumption/generated/api/Support/UsageDetailsKind.cs new file mode 100644 index 000000000000..2f49c42e0a79 --- /dev/null +++ b/swaggerci/consumption/generated/api/Support/UsageDetailsKind.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.Consumption.Support +{ + + /// Specifies the kind of usage details. + public partial struct UsageDetailsKind : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind Legacy = @"legacy"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind Modern = @"modern"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to UsageDetailsKind + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new UsageDetailsKind(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type UsageDetailsKind + /// 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.Consumption.Support.UsageDetailsKind e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type UsageDetailsKind (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 UsageDetailsKind && Equals((UsageDetailsKind)obj); + } + + /// Returns hashCode for enum UsageDetailsKind + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for UsageDetailsKind + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private UsageDetailsKind(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to UsageDetailsKind + /// the value to convert to an instance of . + + public static implicit operator UsageDetailsKind(string value) + { + return new UsageDetailsKind(value); + } + + /// Implicit operator to convert UsageDetailsKind to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind e) + { + return e._value; + } + + /// Overriding != operator for enum UsageDetailsKind + /// 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.Consumption.Support.UsageDetailsKind e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum UsageDetailsKind + /// 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.Consumption.Support.UsageDetailsKind e1, Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.UsageDetailsKind e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionAggregatedCost_Get.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionAggregatedCost_Get.cs new file mode 100644 index 000000000000..6e31dcb9f759 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionAggregatedCost_Get.cs @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Provides the aggregate cost of a management group and all child management groups by current billing period. + /// + /// + /// [OpenAPI] GetByManagementGroup=>GET:"/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionAggregatedCost_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Provides the aggregate cost of a management group and all child management groups by current billing period.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionAggregatedCost_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter + /// supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a + /// key value pair string where key and value is separated by a colon (:). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managementGroupId; + + /// Azure Management Group ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Management Group ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Management Group ID.", + SerializedName = @"managementGroupId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string ManagementGroupId { get => this._managementGroupId; set => this._managementGroupId = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionAggregatedCost_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AggregatedCostGetByManagementGroup(ManagementGroupId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ManagementGroupId=ManagementGroupId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ManagementGroupId=ManagementGroupId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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 { ManagementGroupId=ManagementGroupId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + /// 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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionAggregatedCost_Get1.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionAggregatedCost_Get1.cs new file mode 100644 index 000000000000..cb464cb28fcd --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionAggregatedCost_Get1.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Provides the aggregate cost of a management group and all child management groups by specified billing period + /// + /// + /// [OpenAPI] GetForBillingPeriodByManagementGroup=>GET:"/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/aggregatedCost" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionAggregatedCost_Get1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Provides the aggregate cost of a management group and all child management groups by specified billing period")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionAggregatedCost_Get1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 _billingPeriodName; + + /// Billing Period Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Billing Period Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Billing Period Name.", + SerializedName = @"billingPeriodName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string BillingPeriodName { get => this._billingPeriodName; set => this._billingPeriodName = 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managementGroupId; + + /// Azure Management Group ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Management Group ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Management Group ID.", + SerializedName = @"managementGroupId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string ManagementGroupId { get => this._managementGroupId; set => this._managementGroupId = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionAggregatedCost_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AggregatedCostGetForBillingPeriodByManagementGroup(ManagementGroupId, BillingPeriodName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ManagementGroupId=ManagementGroupId,BillingPeriodName=BillingPeriodName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ManagementGroupId=ManagementGroupId, BillingPeriodName=BillingPeriodName }) + { + 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 { ManagementGroupId=ManagementGroupId, BillingPeriodName=BillingPeriodName }) + { + 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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + /// 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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionAggregatedCost_GetViaIdentity.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionAggregatedCost_GetViaIdentity.cs new file mode 100644 index 000000000000..628c1341618c --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionAggregatedCost_GetViaIdentity.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Provides the aggregate cost of a management group and all child management groups by current billing period. + /// + /// + /// [OpenAPI] GetByManagementGroup=>GET:"/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionAggregatedCost_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Provides the aggregate cost of a management group and all child management groups by current billing period.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionAggregatedCost_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter + /// supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a + /// key value pair string where key and value is separated by a colon (:). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity 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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionAggregatedCost_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AggregatedCostGetByManagementGroupViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ManagementGroupId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagementGroupId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AggregatedCostGetByManagementGroup(InputObject.ManagementGroupId ?? null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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 }) + { + 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 }) + { + 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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + /// 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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionAggregatedCost_GetViaIdentity1.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionAggregatedCost_GetViaIdentity1.cs new file mode 100644 index 000000000000..974be6a56f23 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionAggregatedCost_GetViaIdentity1.cs @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Provides the aggregate cost of a management group and all child management groups by specified billing period + /// + /// + /// [OpenAPI] GetForBillingPeriodByManagementGroup=>GET:"/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/aggregatedCost" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionAggregatedCost_GetViaIdentity1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Provides the aggregate cost of a management group and all child management groups by specified billing period")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionAggregatedCost_GetViaIdentity1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity 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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionAggregatedCost_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AggregatedCostGetForBillingPeriodByManagementGroupViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ManagementGroupId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagementGroupId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.BillingPeriodName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BillingPeriodName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AggregatedCostGetForBillingPeriodByManagementGroup(InputObject.ManagementGroupId ?? null, InputObject.BillingPeriodName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + /// 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.Consumption.Models.Api20211001.IManagementGroupAggregatedCostResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBalance_Get.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBalance_Get.cs new file mode 100644 index 000000000000..b6a0c1ae2e8b --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBalance_Get.cs @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or later. + /// + /// + /// [OpenAPI] GetByBillingAccount=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionBalance_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or later.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionBalance_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 _billingAccountId; + + /// BillingAccount ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "BillingAccount ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"BillingAccount ID", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBalance + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionBalance_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BalancesGetByBillingAccount(BillingAccountId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId }) + { + 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 }) + { + 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.Consumption.Models.Api20211001.IBalance + /// 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.Consumption.Models.Api20211001.IBalance + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBalance_Get1.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBalance_Get1.cs new file mode 100644 index 000000000000..4234248d9666 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBalance_Get1.cs @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only for May + /// 1, 2014 or later. + /// + /// + /// [OpenAPI] GetForBillingPeriodByBillingAccount=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionBalance_Get1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only for May 1, 2014 or later.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionBalance_Get1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 _billingAccountId; + + /// BillingAccount ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "BillingAccount ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"BillingAccount ID", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string BillingAccountId { get => this._billingAccountId; set => this._billingAccountId = value; } + + /// Backing field for property. + private string _billingPeriodName; + + /// Billing Period Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Billing Period Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Billing Period Name.", + SerializedName = @"billingPeriodName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string BillingPeriodName { get => this._billingPeriodName; set => this._billingPeriodName = 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBalance + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionBalance_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BalancesGetForBillingPeriodByBillingAccount(BillingAccountId, BillingPeriodName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId,BillingPeriodName=BillingPeriodName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId, BillingPeriodName=BillingPeriodName }) + { + 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, BillingPeriodName=BillingPeriodName }) + { + 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.Consumption.Models.Api20211001.IBalance + /// 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.Consumption.Models.Api20211001.IBalance + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBalance_GetViaIdentity.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBalance_GetViaIdentity.cs new file mode 100644 index 000000000000..1d3bf7d94213 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBalance_GetViaIdentity.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or later. + /// + /// + /// [OpenAPI] GetByBillingAccount=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionBalance_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or later.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionBalance_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity 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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBalance + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionBalance_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BalancesGetByBillingAccountViaIdentity(InputObject.Id, 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.BalancesGetByBillingAccount(InputObject.BillingAccountId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBalance + /// 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.Consumption.Models.Api20211001.IBalance + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBalance_GetViaIdentity1.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBalance_GetViaIdentity1.cs new file mode 100644 index 000000000000..7f8e4b154178 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBalance_GetViaIdentity1.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only for May + /// 1, 2014 or later. + /// + /// + /// [OpenAPI] GetForBillingPeriodByBillingAccount=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionBalance_GetViaIdentity1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBalance))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only for May 1, 2014 or later.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionBalance_GetViaIdentity1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity 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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBalance + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionBalance_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BalancesGetForBillingPeriodByBillingAccountViaIdentity(InputObject.Id, 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.BillingPeriodName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BillingPeriodName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BalancesGetForBillingPeriodByBillingAccount(InputObject.BillingAccountId ?? null, InputObject.BillingPeriodName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBalance + /// 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.Consumption.Models.Api20211001.IBalance + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBudget_Get.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBudget_Get.cs new file mode 100644 index 000000000000..780fdeed71e6 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBudget_Get.cs @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// Gets the budget for the scope by budget name. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionBudget_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Gets the budget for the scope by budget name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionBudget_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Budget Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Budget Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Budget Name.", + SerializedName = @"budgetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BudgetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection + /// scope. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBudget + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionBudget_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BudgetsGet(Scope, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBudget + /// 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.Consumption.Models.Api20211001.IBudget + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBudget_GetViaIdentity.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBudget_GetViaIdentity.cs new file mode 100644 index 000000000000..64ef96a01759 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBudget_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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// Gets the budget for the scope by budget name. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionBudget_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Gets the budget for the scope by budget name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionBudget_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity 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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBudget + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionBudget_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BudgetsGetViaIdentity(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.BudgetName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BudgetName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BudgetsGet(InputObject.Scope ?? null, InputObject.BudgetName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBudget + /// 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.Consumption.Models.Api20211001.IBudget + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBudget_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBudget_List.cs new file mode 100644 index 000000000000..36b7c87d2f7f --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionBudget_List.cs @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// Lists all budgets for the defined scope. + /// + /// [OpenAPI] List=>GET:"/{scope}/providers/Microsoft.Consumption/budgets" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionBudget_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists all budgets for the defined scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionBudget_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection + /// scope. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBudgetsListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionBudget_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BudgetsList(Scope, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBudgetsListResult + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BudgetsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionCharge_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionCharge_List.cs new file mode 100644 index 000000000000..2c6e9539301b --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionCharge_List.cs @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// Lists the charges based for the defined scope. + /// + /// [OpenAPI] List=>GET:"/{scope}/providers/Microsoft.Consumption/charges" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionCharge_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IChargeSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists the charges based for the defined scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionCharge_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 _apply; + + /// + /// May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId + /// (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId.", + SerializedName = @"$apply", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string Apply { get => this._apply; set => this._apply = 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 = false, HelpMessage = "End date")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"End date", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string EndDate { get => this._endDate; set => this._endDate = value; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter supports + /// 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value + /// pair string where key and value is separated by a colon (:). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with charges operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + /// for Department scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + /// for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing period to the scope using + /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope + /// use '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + /// 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 charges operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with charges operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private string _startDate; + + /// Start date + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start date")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start date", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IChargesListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionCharge_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ChargesList(Scope, this.InvocationInformation.BoundParameters.ContainsKey("StartDate") ? StartDate : null, this.InvocationInformation.BoundParameters.ContainsKey("EndDate") ? EndDate : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Apply") ? Apply : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,StartDate=this.InvocationInformation.BoundParameters.ContainsKey("StartDate") ? StartDate : null,EndDate=this.InvocationInformation.BoundParameters.ContainsKey("EndDate") ? EndDate : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Apply=this.InvocationInformation.BoundParameters.ContainsKey("Apply") ? Apply : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, StartDate=this.InvocationInformation.BoundParameters.ContainsKey("StartDate") ? StartDate : null, EndDate=this.InvocationInformation.BoundParameters.ContainsKey("EndDate") ? EndDate : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Apply=this.InvocationInformation.BoundParameters.ContainsKey("Apply") ? Apply : 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, StartDate=this.InvocationInformation.BoundParameters.ContainsKey("StartDate") ? StartDate : null, EndDate=this.InvocationInformation.BoundParameters.ContainsKey("EndDate") ? EndDate : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Apply=this.InvocationInformation.BoundParameters.ContainsKey("Apply") ? Apply : 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.Consumption.Models.Api20211001.IChargesListResult + /// 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/consumption/generated/cmdlets/GetAzConsumptionCredit_Get.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionCredit_Get.cs new file mode 100644 index 000000000000..be08f5d3cf5b --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionCredit_Get.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// The credit summary by billingAccountId and billingProfileId. + /// + /// [OpenAPI] Get=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/credits/balanceSummary" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionCredit_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"The credit summary by billingAccountId and billingProfileId.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionCredit_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 _billingAccountId; + + /// BillingAccount ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "BillingAccount ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"BillingAccount ID", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string BillingAccountId { get => this._billingAccountId; set => this._billingAccountId = value; } + + /// Backing field for property. + private string _billingProfileId; + + /// Azure Billing Profile ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Billing Profile ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Billing Profile ID.", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.ICreditSummary + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionCredit_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.CreditsGet(BillingAccountId, BillingProfileId, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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 }) + { + 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 }) + { + 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.Consumption.Models.Api20211001.ICreditSummary + /// 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.Consumption.Models.Api20211001.ICreditSummary + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionCredit_GetViaIdentity.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionCredit_GetViaIdentity.cs new file mode 100644 index 000000000000..567630377063 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionCredit_GetViaIdentity.cs @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// The credit summary by billingAccountId and billingProfileId. + /// + /// [OpenAPI] Get=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/credits/balanceSummary" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionCredit_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"The credit summary by billingAccountId and billingProfileId.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionCredit_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity 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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.ICreditSummary + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionCredit_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.CreditsGetViaIdentity(InputObject.Id, onOk, onNoContent, 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.CreditsGet(InputObject.BillingAccountId ?? null, InputObject.BillingProfileId ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ICreditSummary + /// 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.Consumption.Models.Api20211001.ICreditSummary + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionEvent_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionEvent_List.cs new file mode 100644 index 000000000000..59d167be3475 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionEvent_List.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing + /// profile for a given start and end date. + /// + /// + /// [OpenAPI] ListByBillingProfile=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/events" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionEvent_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing profile for a given start and end date.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionEvent_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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; + + /// Backing field for property. + private string _billingAccountId; + + /// BillingAccount ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "BillingAccount ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"BillingAccount ID", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string BillingAccountId { get => this._billingAccountId; set => this._billingAccountId = value; } + + /// Backing field for property. + private string _billingProfileId; + + /// Azure Billing Profile ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Billing Profile ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Billing Profile ID.", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"End date", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Start date", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IEvents + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionEvent_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventsListByBillingProfile(BillingAccountId, BillingProfileId, StartDate, EndDate, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IEvents + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventsListByBillingProfile_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionEvent_List1.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionEvent_List1.cs new file mode 100644 index 000000000000..2f3b6c7394ce --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionEvent_List1.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing + /// profile for a given start and end date. + /// + /// + /// [OpenAPI] ListByBillingAccount=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/events" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionEvent_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IEventSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing profile for a given start and end date.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionEvent_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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; + + /// Backing field for property. + private string _billingAccountId; + + /// BillingAccount ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "BillingAccount ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"BillingAccount ID", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + /// It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated + /// by a colon (:). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IEvents + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionEvent_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventsListByBillingAccount(BillingAccountId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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 { BillingAccountId=BillingAccountId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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.Consumption.Models.Api20211001.IEvents + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventsListByBillingAccount_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionLot_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionLot_List.cs new file mode 100644 index 000000000000..0fc815619eaa --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionLot_List.cs @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft Customer Agreements + /// (MCA) billing accounts. + /// + /// + /// [OpenAPI] ListByBillingProfile=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/lots" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionLot_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft Customer Agreements (MCA) billing accounts.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionLot_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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; + + /// Backing field for property. + private string _billingAccountId; + + /// BillingAccount ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "BillingAccount ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"BillingAccount ID", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string BillingAccountId { get => this._billingAccountId; set => this._billingAccountId = value; } + + /// Backing field for property. + private string _billingProfileId; + + /// Azure Billing Profile ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Billing Profile ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Billing Profile ID.", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.ILots + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionLot_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LotsListByBillingProfile(BillingAccountId, BillingProfileId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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 }) + { + 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 }) + { + 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.Consumption.Models.Api20211001.ILots + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LotsListByBillingProfile_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionLot_List1.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionLot_List1.cs new file mode 100644 index 000000000000..5ce6235454dc --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionLot_List1.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft Customer + /// Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. + /// + /// + /// [OpenAPI] ListByBillingAccount=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/lots" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionLot_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionLot_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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; + + /// Backing field for property. + private string _billingAccountId; + + /// BillingAccount ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "BillingAccount ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"BillingAccount ID", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It + /// does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated + /// by a colon (:). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.ILots + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionLot_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LotsListByBillingAccount(BillingAccountId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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 { BillingAccountId=BillingAccountId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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.Consumption.Models.Api20211001.ILots + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LotsListByBillingAccount_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionLot_List2.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionLot_List2.cs new file mode 100644 index 000000000000..88998ff9e034 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionLot_List2.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing accounts. + /// + /// + /// [OpenAPI] ListByCustomer=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}/providers/Microsoft.Consumption/lots" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionLot_List2")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ILotSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing accounts.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionLot_List2 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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; + + /// Backing field for property. + private string _billingAccountId; + + /// BillingAccount ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "BillingAccount ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"BillingAccount ID", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _customerId; + + /// Customer ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Customer ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Customer ID", + SerializedName = @"customerId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string CustomerId { get => this._customerId; set => this._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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. Tag + /// filter is a key value pair string where key and value is separated by a colon (:). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. Tag filter is a key value pair string where key and value is separated by a colon (:).")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. Tag filter is a key value pair string where key and value is separated by a colon (:).", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.ILots + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionLot_List2() + { + + } + + /// 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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LotsListByCustomer(BillingAccountId, CustomerId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId,CustomerId=CustomerId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId, CustomerId=CustomerId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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 { BillingAccountId=BillingAccountId, CustomerId=CustomerId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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.Consumption.Models.Api20211001.ILots + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LotsListByCustomer_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionMarketplace_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionMarketplace_List.cs new file mode 100644 index 000000000000..cd87c91cd70a --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionMarketplace_List.cs @@ -0,0 +1,492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, 2014 + /// or later. + /// + /// + /// [OpenAPI] List=>GET:"/{scope}/providers/Microsoft.Consumption/marketplaces" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionMarketplace_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IMarketplace))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, 2014 or later.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionMarketplace_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, + /// properties/instanceName or properties/instanceId. 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 marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with marketplace 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 + /// and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, + /// billing account, department, enrollment account and ManagementGroup, you can also add billing period to the scope using + /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope + /// use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope associated with marketplace 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and ManagementGroup, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with marketplace 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and ManagementGroup, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 marketplaces. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to limit the number of results to the most recent N marketplaces.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to limit the number of results to the most recent N marketplaces.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IMarketplacesListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionMarketplace_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MarketplacesList(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Scope, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?),Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null,Scope=Scope}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, 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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, 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 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.Consumption.Models.Api20211001.IMarketplacesListResult + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MarketplacesList_Call(requestMessage, onOk, onNoContent, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionOperation_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionOperation_List.cs new file mode 100644 index 000000000000..a6cda8ffe013 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionOperation_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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// Lists all of the available consumption REST API operations. + /// + /// [OpenAPI] List=>GET:"/providers/Microsoft.Consumption/operations" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionOperation_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists all of the available consumption REST API operations.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionOperation_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionOperation_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList(onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/cmdlets/GetAzConsumptionPriceSheet_Get.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionPriceSheet_Get.cs new file mode 100644 index 000000000000..afee8dd17710 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionPriceSheet_Get.cs @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionPriceSheet_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionPriceSheet_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/meterDetails within a price sheet. By default, these fields are not included when + /// returning price sheet. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string Skiptoken { get => this._skiptoken; set => this._skiptoken = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Azure Subscription ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Subscription ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// May be used to limit the number of results to the top N results. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to limit the number of results to the top N results.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to limit the number of results to the top N results.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IPriceSheetResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionPriceSheet_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PriceSheetGet(this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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,Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?),SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), SubscriptionId=SubscriptionId }) + { + 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, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), SubscriptionId=SubscriptionId }) + { + 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.Consumption.Models.Api20211001.IPriceSheetResult + /// 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.Consumption.Models.Api20211001.IPriceSheetResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionPriceSheet_Get1.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionPriceSheet_Get1.cs new file mode 100644 index 000000000000..48b69fea5956 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionPriceSheet_Get1.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only for May + /// 1, 2014 or later. + /// + /// + /// [OpenAPI] GetByBillingPeriod=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionPriceSheet_Get1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only for May 1, 2014 or later.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionPriceSheet_Get1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 _billingPeriodName; + + /// Billing Period Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Billing Period Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Billing Period Name.", + SerializedName = @"billingPeriodName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string BillingPeriodName { get => this._billingPeriodName; set => this._billingPeriodName = 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/meterDetails within a price sheet. By default, these fields are not included when + /// returning price sheet. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string Skiptoken { get => this._skiptoken; set => this._skiptoken = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// Azure Subscription ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Subscription ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// May be used to limit the number of results to the top N results. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to limit the number of results to the top N results.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to limit the number of results to the top N results.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IPriceSheetResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionPriceSheet_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PriceSheetGetByBillingPeriod(this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), SubscriptionId, BillingPeriodName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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,Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?),SubscriptionId=SubscriptionId,BillingPeriodName=BillingPeriodName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), SubscriptionId=SubscriptionId, BillingPeriodName=BillingPeriodName }) + { + 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, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), SubscriptionId=SubscriptionId, BillingPeriodName=BillingPeriodName }) + { + 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.Consumption.Models.Api20211001.IPriceSheetResult + /// 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.Consumption.Models.Api20211001.IPriceSheetResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionPriceSheet_GetViaIdentity.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionPriceSheet_GetViaIdentity.cs new file mode 100644 index 000000000000..b3f9bc03e799 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionPriceSheet_GetViaIdentity.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionPriceSheet_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionPriceSheet_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/meterDetails within a price sheet. By default, these fields are not included when + /// returning price sheet. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity 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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 top N results. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to limit the number of results to the top N results.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to limit the number of results to the top N results.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IPriceSheetResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionPriceSheet_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PriceSheetGetViaIdentity(InputObject.Id, 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.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PriceSheetGet(this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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,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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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, 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 { 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.Consumption.Models.Api20211001.IPriceSheetResult + /// 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.Consumption.Models.Api20211001.IPriceSheetResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionPriceSheet_GetViaIdentity1.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionPriceSheet_GetViaIdentity1.cs new file mode 100644 index 000000000000..f945dbb29e11 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionPriceSheet_GetViaIdentity1.cs @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only for May + /// 1, 2014 or later. + /// + /// + /// [OpenAPI] GetByBillingPeriod=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionPriceSheet_GetViaIdentity1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IPriceSheetResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only for May 1, 2014 or later.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionPriceSheet_GetViaIdentity1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/meterDetails within a price sheet. By default, these fields are not included when + /// returning price sheet. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity 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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 top N results. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to limit the number of results to the top N results.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to limit the number of results to the top N results.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IPriceSheetResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionPriceSheet_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PriceSheetGetByBillingPeriodViaIdentity(InputObject.Id, 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.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.BillingPeriodName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BillingPeriodName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PriceSheetGetByBillingPeriod(this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), InputObject.SubscriptionId ?? null, InputObject.BillingPeriodName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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,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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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, 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 { 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.Consumption.Models.Api20211001.IPriceSheetResult + /// 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.Consumption.Models.Api20211001.IPriceSheetResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationDetail_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationDetail_List.cs new file mode 100644 index 000000000000..60e10483fd03 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationDetail_List.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently callers + /// get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. + /// + /// + /// [OpenAPI] ListByReservationOrder=>GET:"/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionReservationDetail_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionReservationDetail_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' + /// and 'ge' + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _reservationOrderId; + + /// Order Id of the reservation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Order Id of the reservation")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string ReservationOrderId { get => this._reservationOrderId; set => this._reservationOrderId = 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.Consumption.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.Consumption.Models.Api20211001.IReservationDetailsListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionReservationDetail_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationsDetailsListByReservationOrder(ReservationOrderId, Filter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,Filter=Filter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId, Filter=Filter }) + { + 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 { ReservationOrderId=ReservationOrderId, Filter=Filter }) + { + 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.Consumption.Models.Api20211001.IReservationDetailsListResult + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationsDetailsListByReservationOrder_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationDetail_List1.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationDetail_List1.cs new file mode 100644 index 000000000000..34d7e341baab --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationDetail_List1.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently callers + /// get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. + /// + /// + /// [OpenAPI] ListByReservationOrderAndReservation=>GET:"/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionReservationDetail_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionReservationDetail_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' + /// and 'ge' + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' ")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' ", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _reservationId; + + /// Id of the reservation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Id of the reservation")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id of the reservation", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string ReservationId { get => this._reservationId; set => this._reservationId = value; } + + /// Backing field for property. + private string _reservationOrderId; + + /// Order Id of the reservation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Order Id of the reservation")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string ReservationOrderId { get => this._reservationOrderId; set => this._reservationOrderId = 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.Consumption.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.Consumption.Models.Api20211001.IReservationDetailsListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionReservationDetail_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationsDetailsListByReservationOrderAndReservation(ReservationOrderId, ReservationId, Filter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,ReservationId=ReservationId,Filter=Filter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId, ReservationId=ReservationId, Filter=Filter }) + { + 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 { ReservationOrderId=ReservationOrderId, ReservationId=ReservationId, Filter=Filter }) + { + 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.Consumption.Models.Api20211001.IReservationDetailsListResult + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationsDetailsListByReservationOrderAndReservation_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationRecommendationDetail_Get.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationRecommendationDetail_Get.cs new file mode 100644 index 000000000000..67b0f303b178 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationRecommendationDetail_Get.cs @@ -0,0 +1,492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Details of a reservation recommendation for what-if analysis of reserved instances. + /// + /// + /// [OpenAPI] Get=>GET:"/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendationDetails" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionReservationRecommendationDetail_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Details of a reservation recommendation for what-if analysis of reserved instances.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionReservationRecommendationDetail_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod _lookBackPeriod; + + /// Filter the time period on which reservation recommendation results are based. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Filter the time period on which reservation recommendation results are based.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Filter the time period on which reservation recommendation results are based.", + SerializedName = @"lookBackPeriod", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod))] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod LookBackPeriod { get => this._lookBackPeriod; set => this._lookBackPeriod = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _product; + + /// + /// Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 + /// (for Managed Disks) + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks)")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks)", + SerializedName = @"product", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string Product { get => this._product; set => this._product = 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _region; + + /// Used to select the region the recommendation should be generated for. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Used to select the region the recommendation should be generated for.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Used to select the region the recommendation should be generated for.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string Region { get => this._region; set => this._region = value; } + + /// Backing field for property. + private string _resourceScope; + + /// + /// The scope associated with reservation recommendation details operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for billingProfile scope + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope associated with reservation recommendation details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with reservation recommendation details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope", + SerializedName = @"resourceScope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string ResourceScope { get => this._resourceScope; set => this._resourceScope = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope _scope; + + /// Scope of the reservation. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Scope of the reservation.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Scope of the reservation.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope))] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term _term; + + /// Specify length of reservation recommendation term. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Specify length of reservation recommendation term.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specify length of reservation recommendation term.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term))] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term Term { get => this._term; set => this._term = 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.Consumption.Models.Api20211001.IHighCasedErrorResponse + /// 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.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionReservationRecommendationDetail_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationRecommendationDetailsGet(ResourceScope, Scope, Region, Term, LookBackPeriod, Product, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceScope=ResourceScope,Scope=Scope,Region=Region,Term=Term,LookBackPeriod=LookBackPeriod,Product=Product}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IHighCasedErrorResponse + /// 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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceScope=ResourceScope, Scope=Scope, Region=Region, Term=Term, LookBackPeriod=LookBackPeriod, Product=Product }) + { + 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 { ResourceScope=ResourceScope, Scope=Scope, Region=Region, Term=Term, LookBackPeriod=LookBackPeriod, Product=Product }) + { + 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.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel + /// 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.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationRecommendationDetail_GetViaIdentity.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationRecommendationDetail_GetViaIdentity.cs new file mode 100644 index 000000000000..93a926efc58b --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationRecommendationDetail_GetViaIdentity.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Details of a reservation recommendation for what-if analysis of reserved instances. + /// + /// + /// [OpenAPI] Get=>GET:"/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendationDetails" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionReservationRecommendationDetail_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Details of a reservation recommendation for what-if analysis of reserved instances.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionReservationRecommendationDetail_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity 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; } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod _lookBackPeriod; + + /// Filter the time period on which reservation recommendation results are based. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Filter the time period on which reservation recommendation results are based.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Filter the time period on which reservation recommendation results are based.", + SerializedName = @"lookBackPeriod", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod))] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.LookBackPeriod LookBackPeriod { get => this._lookBackPeriod; set => this._lookBackPeriod = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _product; + + /// + /// Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 + /// (for Managed Disks) + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks)")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks)", + SerializedName = @"product", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string Product { get => this._product; set => this._product = 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _region; + + /// Used to select the region the recommendation should be generated for. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Used to select the region the recommendation should be generated for.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Used to select the region the recommendation should be generated for.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string Region { get => this._region; set => this._region = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope _scope; + + /// Scope of the reservation. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Scope of the reservation.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Scope of the reservation.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope))] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Scope Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term _term; + + /// Specify length of reservation recommendation term. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Specify length of reservation recommendation term.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specify length of reservation recommendation term.", + SerializedName = @"term", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term))] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Term Term { get => this._term; set => this._term = 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.Consumption.Models.Api20211001.IHighCasedErrorResponse + /// 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.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionReservationRecommendationDetail_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ReservationRecommendationDetailsGetViaIdentity(InputObject.Id, Scope, Region, Term, LookBackPeriod, Product, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceScope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceScope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ReservationRecommendationDetailsGet(InputObject.ResourceScope ?? null, Scope, Region, Term, LookBackPeriod, Product, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Region=Region,Term=Term,LookBackPeriod=LookBackPeriod,Product=Product}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IHighCasedErrorResponse + /// 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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Region=Region, Term=Term, LookBackPeriod=LookBackPeriod, Product=Product }) + { + 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, Region=Region, Term=Term, LookBackPeriod=LookBackPeriod, Product=Product }) + { + 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.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel + /// 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.Consumption.Models.Api20211001.IReservationRecommendationDetailsModel + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationRecommendation_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationRecommendation_List.cs new file mode 100644 index 000000000000..945ddb540fc3 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationRecommendation_List.cs @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// List of recommendations for purchasing reserved instances. + /// + /// [OpenAPI] List=>GET:"/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendations" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionReservationRecommendation_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationRecommendation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"List of recommendations for purchasing reserved instances.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionReservationRecommendation_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default + /// value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', + /// 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', + /// 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', + /// 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceScope; + + /// + /// The scope associated with reservation recommendations operations. This includes '/subscriptions/{subscriptionId}/' for + /// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for billingProfile scope + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope associated with reservation recommendations operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with reservation recommendations operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope", + SerializedName = @"resourceScope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string ResourceScope { get => this._resourceScope; set => this._resourceScope = 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.Consumption.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.Consumption.Models.Api20211001.IReservationRecommendationsListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionReservationRecommendation_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationRecommendationsList(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, ResourceScope, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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,ResourceScope=ResourceScope}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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, ResourceScope=ResourceScope }) + { + 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, ResourceScope=ResourceScope }) + { + 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.Consumption.Models.Api20211001.IReservationRecommendationsListResult + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationRecommendationsList_Call(requestMessage, onOk, onNoContent, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationSummary_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationSummary_List.cs new file mode 100644 index 000000000000..5426ed805e71 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationSummary_List.cs @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// Lists the reservations summaries for daily or monthly grain. + /// + /// [OpenAPI] ListByReservationOrder=>GET:"/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionReservationSummary_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists the reservations summaries for daily or monthly grain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionReservationSummary_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain _grain; + + /// Can be daily or monthly + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Can be daily or monthly")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Can be daily or monthly", + SerializedName = @"grain", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain))] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain Grain { get => this._grain; set => this._grain = 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _reservationOrderId; + + /// Order Id of the reservation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Order Id of the reservation")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string ReservationOrderId { get => this._reservationOrderId; set => this._reservationOrderId = 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.Consumption.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.Consumption.Models.Api20211001.IReservationSummariesListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionReservationSummary_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationsSummariesListByReservationOrder(ReservationOrderId, Grain, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,Grain=Grain,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId, Grain=Grain, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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 { ReservationOrderId=ReservationOrderId, Grain=Grain, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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.Consumption.Models.Api20211001.IReservationSummariesListResult + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationsSummariesListByReservationOrder_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationSummary_List1.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationSummary_List1.cs new file mode 100644 index 000000000000..9ca7ed5f29af --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationSummary_List1.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// Lists the reservations summaries for daily or monthly grain. + /// + /// [OpenAPI] ListByReservationOrderAndReservation=>GET:"/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionReservationSummary_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists the reservations summaries for daily or monthly grain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionReservationSummary_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain _grain; + + /// Can be daily or monthly + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Can be daily or monthly")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Can be daily or monthly", + SerializedName = @"grain", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain))] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain Grain { get => this._grain; set => this._grain = 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _reservationId; + + /// Id of the reservation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Id of the reservation")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id of the reservation", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string ReservationId { get => this._reservationId; set => this._reservationId = value; } + + /// Backing field for property. + private string _reservationOrderId; + + /// Order Id of the reservation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Order Id of the reservation")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string ReservationOrderId { get => this._reservationOrderId; set => this._reservationOrderId = 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.Consumption.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.Consumption.Models.Api20211001.IReservationSummariesListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionReservationSummary_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationsSummariesListByReservationOrderAndReservation(ReservationOrderId, ReservationId, Grain, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,ReservationId=ReservationId,Grain=Grain,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId, ReservationId=ReservationId, Grain=Grain, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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 { ReservationOrderId=ReservationOrderId, ReservationId=ReservationId, Grain=Grain, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : 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.Consumption.Models.Api20211001.IReservationSummariesListResult + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationsSummariesListByReservationOrderAndReservation_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationTransaction_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationTransaction_List.cs new file mode 100644 index 000000000000..7a90f8983c66 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationTransaction_List.cs @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted along with + /// its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May 2021. This + /// refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase + /// was made. + /// + /// + /// [OpenAPI] List=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionReservationTransaction_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationTransaction))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionReservationTransaction_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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; + + /// Backing field for property. + private string _billingAccountId; + + /// BillingAccount ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "BillingAccount ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"BillingAccount ID", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports + /// 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + /// will include data for the entire December 2020 month (i.e. will contain records for dates December 30 and 31) + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for the entire December 2020 month (i.e. will contain records for dates December 30 and 31)")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for the entire December 2020 month (i.e. will contain records for dates December 30 and 31)", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IReservationTransactionsListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionReservationTransaction_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationTransactionsList(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, BillingAccountId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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,BillingAccountId=BillingAccountId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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, BillingAccountId=BillingAccountId }) + { + 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, BillingAccountId=BillingAccountId }) + { + 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.Consumption.Models.Api20211001.IReservationTransactionsListResult + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationTransactionsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationTransaction_List1.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationTransaction_List1.cs new file mode 100644 index 000000000000..fe6f5788c81a --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationTransaction_List1.cs @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// List of transactions for reserved instances on billing profile scope. The refund transactions are posted along with its + /// purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May 2021. This refund + /// transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made. + /// + /// + /// [OpenAPI] ListByBillingProfile=>GET:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/reservationTransactions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionReservationTransaction_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IModernReservationTransaction))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"List of transactions for reserved instances on billing profile scope. The refund transactions are posted along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionReservationTransaction_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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; + + /// Backing field for property. + private string _billingAccountId; + + /// BillingAccount ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "BillingAccount ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"BillingAccount ID", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string BillingAccountId { get => this._billingAccountId; set => this._billingAccountId = value; } + + /// Backing field for property. + private string _billingProfileId; + + /// Azure Billing Profile ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Billing Profile ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Billing Profile ID.", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports + /// 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + /// will include data for entire December 2020 month (i.e. will contain records for dates December 30 and 31) + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for entire December 2020 month (i.e. will contain records for dates December 30 and 31)")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for entire December 2020 month (i.e. will contain records for dates December 30 and 31)", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IModernReservationTransactionsListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionReservationTransaction_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationTransactionsListByBillingProfile(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, BillingAccountId, BillingProfileId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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,BillingAccountId=BillingAccountId,BillingProfileId=BillingProfileId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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, BillingAccountId=BillingAccountId, BillingProfileId=BillingProfileId }) + { + 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, BillingAccountId=BillingAccountId, BillingProfileId=BillingProfileId }) + { + 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.Consumption.Models.Api20211001.IModernReservationTransactionsListResult + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationTransactionsListByBillingProfile_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationsDetail_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationsDetail_List.cs new file mode 100644 index 000000000000..0c928fe065d3 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationsDetail_List.cs @@ -0,0 +1,475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Lists the reservations details for the defined scope and provided date range. Note: ARM has a payload size limit of 12MB, + /// so currently callers get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with + /// smaller date ranges. + /// + /// + /// [OpenAPI] List=>GET:"/{resourceScope}/providers/Microsoft.Consumption/reservationDetails" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionReservationsDetail_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationDetail))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists the reservations details for the defined scope and provided date range. Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionReservationsDetail_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _endDate; + + /// End date. Only applicable when querying with billing profile + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "End date. Only applicable when querying with billing profile")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"End date. Only applicable when querying with billing profile", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string EndDate { get => this._endDate; set => this._endDate = value; } + + /// Backing field for property. + private string _filter; + + /// + /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' + /// and 'ge'. Not applicable when querying with billing profile + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _reservationId; + + /// + /// Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string ReservationId { get => this._reservationId; set => this._reservationId = value; } + + /// Backing field for property. + private string _reservationOrderId; + + /// + /// Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string ReservationOrderId { get => this._reservationOrderId; set => this._reservationOrderId = value; } + + /// Backing field for property. + private string _resourceScope; + + /// + /// The scope associated with reservations details operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for BillingProfile scope (modern). + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope associated with reservations details operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). ")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with reservations details operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). ", + SerializedName = @"resourceScope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string ResourceScope { get => this._resourceScope; set => this._resourceScope = value; } + + /// Backing field for property. + private string _startDate; + + /// Start date. Only applicable when querying with billing profile + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start date. Only applicable when querying with billing profile")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start date. Only applicable when querying with billing profile", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IReservationDetailsListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionReservationsDetail_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationsDetailsList(ResourceScope, this.InvocationInformation.BoundParameters.ContainsKey("StartDate") ? StartDate : null, this.InvocationInformation.BoundParameters.ContainsKey("EndDate") ? EndDate : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("ReservationId") ? ReservationId : null, this.InvocationInformation.BoundParameters.ContainsKey("ReservationOrderId") ? ReservationOrderId : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceScope=ResourceScope,StartDate=this.InvocationInformation.BoundParameters.ContainsKey("StartDate") ? StartDate : null,EndDate=this.InvocationInformation.BoundParameters.ContainsKey("EndDate") ? EndDate : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,ReservationId=this.InvocationInformation.BoundParameters.ContainsKey("ReservationId") ? ReservationId : null,ReservationOrderId=this.InvocationInformation.BoundParameters.ContainsKey("ReservationOrderId") ? ReservationOrderId : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceScope=ResourceScope, StartDate=this.InvocationInformation.BoundParameters.ContainsKey("StartDate") ? StartDate : null, EndDate=this.InvocationInformation.BoundParameters.ContainsKey("EndDate") ? EndDate : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, ReservationId=this.InvocationInformation.BoundParameters.ContainsKey("ReservationId") ? ReservationId : null, ReservationOrderId=this.InvocationInformation.BoundParameters.ContainsKey("ReservationOrderId") ? ReservationOrderId : 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 { ResourceScope=ResourceScope, StartDate=this.InvocationInformation.BoundParameters.ContainsKey("StartDate") ? StartDate : null, EndDate=this.InvocationInformation.BoundParameters.ContainsKey("EndDate") ? EndDate : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, ReservationId=this.InvocationInformation.BoundParameters.ContainsKey("ReservationId") ? ReservationId : null, ReservationOrderId=this.InvocationInformation.BoundParameters.ContainsKey("ReservationOrderId") ? ReservationOrderId : 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.Consumption.Models.Api20211001.IReservationDetailsListResult + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationsDetailsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationsSummary_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationsSummary_List.cs new file mode 100644 index 000000000000..1e63e1d9ea72 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionReservationsSummary_List.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// Lists the reservations summaries for the defined scope daily or monthly grain. + /// + /// [OpenAPI] List=>GET:"/{resourceScope}/providers/Microsoft.Consumption/reservationSummaries" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionReservationsSummary_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IReservationSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists the reservations summaries for the defined scope daily or monthly grain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionReservationsSummary_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _endDate; + + /// End date. Only applicable when querying with billing profile + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "End date. Only applicable when querying with billing profile")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"End date. Only applicable when querying with billing profile", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string EndDate { get => this._endDate; set => this._endDate = value; } + + /// Backing field for property. + private string _filter; + + /// + /// Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. + /// Not applicable when querying with billing profile + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain _grain; + + /// Can be daily or monthly + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Can be daily or monthly")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Can be daily or monthly", + SerializedName = @"grain", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain))] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Datagrain Grain { get => this._grain; set => this._grain = 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _reservationId; + + /// + /// Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string ReservationId { get => this._reservationId; set => this._reservationId = value; } + + /// Backing field for property. + private string _reservationOrderId; + + /// + /// Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string ReservationOrderId { get => this._reservationOrderId; set => this._reservationOrderId = value; } + + /// Backing field for property. + private string _resourceScope; + + /// + /// The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + /// for BillingProfile scope (modern). + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). ")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). ", + SerializedName = @"resourceScope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string ResourceScope { get => this._resourceScope; set => this._resourceScope = value; } + + /// Backing field for property. + private string _startDate; + + /// Start date. Only applicable when querying with billing profile + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start date. Only applicable when querying with billing profile")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start date. Only applicable when querying with billing profile", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IReservationSummariesListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionReservationsSummary_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationsSummariesList(ResourceScope, Grain, this.InvocationInformation.BoundParameters.ContainsKey("StartDate") ? StartDate : null, this.InvocationInformation.BoundParameters.ContainsKey("EndDate") ? EndDate : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("ReservationId") ? ReservationId : null, this.InvocationInformation.BoundParameters.ContainsKey("ReservationOrderId") ? ReservationOrderId : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceScope=ResourceScope,Grain=Grain,StartDate=this.InvocationInformation.BoundParameters.ContainsKey("StartDate") ? StartDate : null,EndDate=this.InvocationInformation.BoundParameters.ContainsKey("EndDate") ? EndDate : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,ReservationId=this.InvocationInformation.BoundParameters.ContainsKey("ReservationId") ? ReservationId : null,ReservationOrderId=this.InvocationInformation.BoundParameters.ContainsKey("ReservationOrderId") ? ReservationOrderId : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceScope=ResourceScope, Grain=Grain, StartDate=this.InvocationInformation.BoundParameters.ContainsKey("StartDate") ? StartDate : null, EndDate=this.InvocationInformation.BoundParameters.ContainsKey("EndDate") ? EndDate : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, ReservationId=this.InvocationInformation.BoundParameters.ContainsKey("ReservationId") ? ReservationId : null, ReservationOrderId=this.InvocationInformation.BoundParameters.ContainsKey("ReservationOrderId") ? ReservationOrderId : 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 { ResourceScope=ResourceScope, Grain=Grain, StartDate=this.InvocationInformation.BoundParameters.ContainsKey("StartDate") ? StartDate : null, EndDate=this.InvocationInformation.BoundParameters.ContainsKey("EndDate") ? EndDate : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, ReservationId=this.InvocationInformation.BoundParameters.ContainsKey("ReservationId") ? ReservationId : null, ReservationOrderId=this.InvocationInformation.BoundParameters.ContainsKey("ReservationOrderId") ? ReservationOrderId : 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.Consumption.Models.Api20211001.IReservationSummariesListResult + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationsSummariesList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionTag_Get.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionTag_Get.cs new file mode 100644 index 000000000000..79bdf0a63d2e --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionTag_Get.cs @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// Get all available tag keys for the defined scope + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Consumption/tags" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionTag_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Get all available tag keys for the defined scope")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionTag_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with tags 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management + /// Group scope.. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope associated with tags 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope..")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with tags 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope..", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.ITagsResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionTag_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TagsGet(Scope, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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 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.Consumption.Models.Api20211001.ITagsResult + /// 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.Consumption.Models.Api20211001.ITagsResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionTag_GetViaIdentity.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionTag_GetViaIdentity.cs new file mode 100644 index 000000000000..5dcb40d8cf8e --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionTag_GetViaIdentity.cs @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// Get all available tag keys for the defined scope + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Consumption/tags" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionTag_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Get all available tag keys for the defined scope")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionTag_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity 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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.ITagsResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionTag_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TagsGetViaIdentity(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) ); + } + await this.Client.TagsGet(InputObject.Scope ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.ITagsResult + /// 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.Consumption.Models.Api20211001.ITagsResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/GetAzConsumptionUsageDetail_List.cs b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionUsageDetail_List.cs new file mode 100644 index 000000000000..0f8aeeac840d --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/GetAzConsumptionUsageDetail_List.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later. + /// + /// + /// [OpenAPI] List=>GET:"/{scope}/providers/Microsoft.Consumption/usageDetails" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConsumptionUsageDetail_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IUsageDetail))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class GetAzConsumptionUsageDetail_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/additionalInfo or properties/meterDetails within a list of usage details. By default, + /// these fields are not included when listing usage details. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, + /// properties/reservationId, properties/publisherType or tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. + /// It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated + /// by a colon (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct + /// Offer Type + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype _metric; + + /// Allows to select different type of cost/usage records. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows to select different type of cost/usage records.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows to select different type of cost/usage records.", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype))] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.Metrictype Metric { get => this._metric; set => this._metric = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 + /// and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, + /// billing account, department, enrollment account and management group, you can also add billing period to the scope using + /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope + /// use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + /// 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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.Consumption.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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 usageDetails. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to limit the number of results to the most recent N usageDetails.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to limit the number of results to the most recent N usageDetails.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IUsageDetailsListResult + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 GetAzConsumptionUsageDetail_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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsageDetailsList(Scope, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), this.InvocationInformation.BoundParameters.ContainsKey("Metric") ? Metric : null, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?),Metric=this.InvocationInformation.BoundParameters.ContainsKey("Metric") ? Metric : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), Metric=this.InvocationInformation.BoundParameters.ContainsKey("Metric") ? Metric : 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, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), Metric=this.InvocationInformation.BoundParameters.ContainsKey("Metric") ? Metric : null }) + { + 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.Consumption.Models.Api20211001.IUsageDetailsListResult + /// 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.Consumption.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsageDetailsList_Call(requestMessage, onOk, onNoContent, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/NewAzConsumptionBudget_CreateExpanded.cs b/swaggerci/consumption/generated/cmdlets/NewAzConsumptionBudget_CreateExpanded.cs new file mode 100644 index 000000000000..49963a7cfd40 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/NewAzConsumptionBudget_CreateExpanded.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// + /// The operation to create or update a budget. You can optionally provide an eTag if desired as a form of concurrency control. + /// To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzConsumptionBudget_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"The operation to create or update a budget. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class NewAzConsumptionBudget_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 budget resource. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudget _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.Budget(); + + /// The total amount of cost to track with the budget + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The total amount of cost to track with the budget")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total amount of cost to track with the budget", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + public decimal Amount { get => _parametersBody.Amount ?? default(decimal); set => _parametersBody.Amount = 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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; } + + /// + /// 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBudgetFilterProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetFilterProperties[] FilterAnd { get => _parametersBody.FilterAnd ?? null /* arrayOf */; set => _parametersBody.FilterAnd = 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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Budget Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Budget Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Budget Name.", + SerializedName = @"budgetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BudgetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// Dictionary of notifications associated with the budget. Budget can have up to five notifications. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dictionary of notifications associated with the budget. Budget can have up to five notifications.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of notifications associated with the budget. Budget can have up to five notifications.", + SerializedName = @"notifications", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications) })] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IBudgetPropertiesNotifications Notification { get => _parametersBody.Notification ?? null /* object */; set => _parametersBody.Notification = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection + /// scope. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, + /// and BillingAnnual are only supported by WD customers + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers", + SerializedName = @"timeGrain", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType))] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType TimeGrain { get => _parametersBody.TimeGrain ?? ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Support.TimeGrainType)""); set => _parametersBody.TimeGrain = value; } + + /// + /// The end date for the budget. If not provided, we default this to 10 years from the start date. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date for the budget. If not provided, we default this to 10 years from the start date.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date for the budget. If not provided, we default this to 10 years from the start date.", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodEndDate { get => _parametersBody.TimePeriodEndDate ?? default(global::System.DateTime); set => _parametersBody.TimePeriodEndDate = value; } + + /// The start date for the budget. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date for the budget.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date for the budget.", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodStartDate { get => _parametersBody.TimePeriodStartDate ?? default(global::System.DateTime); set => _parametersBody.TimePeriodStartDate = 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.Consumption.Models.Api20211001.IBudget + /// 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.Consumption.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.Consumption.Models.Api20211001.IBudget + /// 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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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 NewAzConsumptionBudget_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BudgetsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BudgetsCreateOrUpdate(Scope, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Models.Api20211001.IBudget + /// 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.Consumption.Models.Api20211001.IBudget + 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.Consumption.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.Consumption.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.Consumption.Models.Api20211001.IBudget + /// 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.Consumption.Models.Api20211001.IBudget + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/cmdlets/RemoveAzConsumptionBudget_Delete.cs b/swaggerci/consumption/generated/cmdlets/RemoveAzConsumptionBudget_Delete.cs new file mode 100644 index 000000000000..4a4d8644ce28 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/RemoveAzConsumptionBudget_Delete.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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// The operation to delete a budget. + /// + /// [OpenAPI] Delete=>DELETE:"/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzConsumptionBudget_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"The operation to delete a budget.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class RemoveAzConsumptionBudget_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Budget Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Budget Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Budget Name.", + SerializedName = @"budgetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BudgetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection + /// scope. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope.")] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BudgetsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BudgetsDelete(Scope, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzConsumptionBudget_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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/consumption/generated/cmdlets/RemoveAzConsumptionBudget_DeleteViaIdentity.cs b/swaggerci/consumption/generated/cmdlets/RemoveAzConsumptionBudget_DeleteViaIdentity.cs new file mode 100644 index 000000000000..020329de2d73 --- /dev/null +++ b/swaggerci/consumption/generated/cmdlets/RemoveAzConsumptionBudget_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.Consumption.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Extensions; + using System; + + /// The operation to delete a budget. + /// + /// [OpenAPI] Delete=>DELETE:"/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzConsumptionBudget_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Description(@"The operation to delete a budget.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Generated] + public partial class RemoveAzConsumptionBudget_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.ConsumptionManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.IConsumptionIdentity 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.Consumption.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BudgetsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Consumption.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BudgetsDeleteViaIdentity(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.BudgetName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BudgetName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BudgetsDelete(InputObject.Scope ?? null, InputObject.BudgetName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzConsumptionBudget_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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/consumption/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml new file mode 100644 index 000000000000..ae0c12dd4efa --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml new file mode 100644 index 000000000000..a81dae94b4db --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml new file mode 100644 index 000000000000..e3b670a7daff --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec new file mode 100644 index 000000000000..f664d888f3b8 --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 new file mode 100644 index 000000000000..5597a247fce7 --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 new file mode 100644 index 000000000000..67107181add7 --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll new file mode 100644 index 000000000000..18a53248894f Binary files /dev/null and b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll new file mode 100644 index 000000000000..92d06762d6a5 Binary files /dev/null and b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json b/swaggerci/consumption/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/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json new file mode 100644 index 000000000000..7828816a6777 --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json new file mode 100644 index 000000000000..ce563dfdebbe --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json b/swaggerci/consumption/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/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml b/swaggerci/consumption/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/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 new file mode 100644 index 000000000000..bb0bc9e63f5d --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll differ diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 new file mode 100644 index 000000000000..f234bd2dd7e5 --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 new file mode 100644 index 000000000000..4e557723dc33 --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml new file mode 100644 index 000000000000..95d6227f2ef8 --- /dev/null +++ b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/_rels/.rels b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/_rels/.rels new file mode 100644 index 000000000000..95479a0e6d24 --- /dev/null +++ b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/_rels/.rels @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt b/swaggerci/consumption/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt new file mode 100644 index 000000000000..7e294d272854 --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp b/swaggerci/consumption/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/consumption/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/consumption/generated/runtime/AsyncCommandRuntime.cs b/swaggerci/consumption/generated/runtime/AsyncCommandRuntime.cs new file mode 100644 index 000000000000..0f6e5b7b53ba --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + using System.Linq; + + internal interface IAsyncCommandRuntimeExtensions + { + Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/AsyncJob.cs b/swaggerci/consumption/generated/runtime/AsyncJob.cs new file mode 100644 index 000000000000..8c5f7aea572c --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/AsyncOperationResponse.cs b/swaggerci/consumption/generated/runtime/AsyncOperationResponse.cs new file mode 100644 index 000000000000..a107a3b9057b --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs b/swaggerci/consumption/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs new file mode 100644 index 000000000000..f0b9386ff41c --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs b/swaggerci/consumption/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs new file mode 100644 index 000000000000..7fe07c8b2e23 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/swaggerci/consumption/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs new file mode 100644 index 000000000000..1ebe51fe449f --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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.Consumption.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/swaggerci/consumption/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs new file mode 100644 index 000000000000..e3b04367c913 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.MarkdownRenderer; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/swaggerci/consumption/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs new file mode 100644 index 000000000000..1ce1f8b6851b --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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.Consumption.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/swaggerci/consumption/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs new file mode 100644 index 000000000000..248d95d3a0a5 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.PsHelpers; +using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.MarkdownRenderer; +using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.PsProxyTypeExtensions; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/swaggerci/consumption/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs new file mode 100644 index 000000000000..fe0759e2128c --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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: Consumption 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.Consumption.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.Consumption.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 Consumption".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/consumption/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/swaggerci/consumption/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs new file mode 100644 index 000000000000..5d1ec6d2cc6a --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs b/swaggerci/consumption/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs new file mode 100644 index 000000000000..15917985ebf9 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs b/swaggerci/consumption/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs new file mode 100644 index 000000000000..b8ca3101fd06 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs b/swaggerci/consumption/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs new file mode 100644 index 000000000000..1d5c83d230d3 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/CollectionExtensions.cs b/swaggerci/consumption/generated/runtime/BuildTime/CollectionExtensions.cs new file mode 100644 index 000000000000..fccc2ea86337 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/BuildTime/MarkdownRenderer.cs b/swaggerci/consumption/generated/runtime/BuildTime/MarkdownRenderer.cs new file mode 100644 index 000000000000..c9e275cc0967 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.PsProxyOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/Models/PsFormatTypes.cs b/swaggerci/consumption/generated/runtime/BuildTime/Models/PsFormatTypes.cs new file mode 100644 index 000000000000..25d6acf83c75 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs b/swaggerci/consumption/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs new file mode 100644 index 000000000000..49e677360028 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/swaggerci/consumption/generated/runtime/BuildTime/Models/PsHelpTypes.cs new file mode 100644 index 000000000000..1f06b9ca5e45 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/swaggerci/consumption/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs new file mode 100644 index 000000000000..e943030cb583 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/swaggerci/consumption/generated/runtime/BuildTime/Models/PsProxyOutputs.cs new file mode 100644 index 000000000000..565119353705 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.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/consumption/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/swaggerci/consumption/generated/runtime/BuildTime/Models/PsProxyTypes.cs new file mode 100644 index 000000000000..9c3318b88049 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/BuildTime/PsAttributes.cs b/swaggerci/consumption/generated/runtime/BuildTime/PsAttributes.cs new file mode 100644 index 000000000000..3bdecef14dfe --- /dev/null +++ b/swaggerci/consumption/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.Consumption +{ + [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/consumption/generated/runtime/BuildTime/PsExtensions.cs b/swaggerci/consumption/generated/runtime/BuildTime/PsExtensions.cs new file mode 100644 index 000000000000..1c09ae6db011 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/BuildTime/PsHelpers.cs b/swaggerci/consumption/generated/runtime/BuildTime/PsHelpers.cs new file mode 100644 index 000000000000..fc43abe26166 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/BuildTime/StringExtensions.cs b/swaggerci/consumption/generated/runtime/BuildTime/StringExtensions.cs new file mode 100644 index 000000000000..a1c32767093a --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/BuildTime/XmlExtensions.cs b/swaggerci/consumption/generated/runtime/BuildTime/XmlExtensions.cs new file mode 100644 index 000000000000..2ee259393c80 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/CmdInfoHandler.cs b/swaggerci/consumption/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..02da12a0dc9d --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/ConversionException.cs b/swaggerci/consumption/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..ca69945f2e8b --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..60f3519bfd90 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.Json +{ + internal interface IJsonConverter + { + JsonNode ToJson(object value); + + object FromJson(JsonNode node); + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..3dd3421aff6b --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..dc2dd3a425a6 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..869184363572 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..c0bf3991dfbe --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..238d181cf59c --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..2de1b8a0aca1 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..5c9fdf521048 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..b1c74f4d98f8 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..5fd83323f6d7 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..5743a294f094 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..dcb138e7f5ac --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..71cfd8af652f --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..e51352cec6a1 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..f5c067401c8d --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..27a6181f7697 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..fccff39e2455 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..ce5f7ce2af85 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..15e098d842b1 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..d6610d292f8a --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..43d9ea9d3794 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..8010e0c5b76c --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..7b75beaaf798 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/consumption/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..38af08b69c0b --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/consumption/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..da7d96d403a3 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/consumption/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..bda78462b5f9 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/consumption/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..59de9d0bc93f --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.Json; +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.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.Consumption.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/consumption/generated/runtime/Customizations/JsonArray.cs b/swaggerci/consumption/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..9e9ab0102cb9 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/consumption/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..c91d47fa31b0 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Customizations/JsonNode.cs b/swaggerci/consumption/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..b4c2a2aa7e8a --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/consumption/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..fcde1fbe83df --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Customizations/JsonObject.cs b/swaggerci/consumption/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..a12c0305673b --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonObject + { + internal override object ToValue() => Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/Customizations/JsonString.cs b/swaggerci/consumption/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..2d2e84fee7da --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/consumption/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..57d694cc07e0 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Debugging.cs b/swaggerci/consumption/generated/runtime/Debugging.cs new file mode 100644 index 000000000000..8839770c5bb8 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/DictionaryExtensions.cs b/swaggerci/consumption/generated/runtime/DictionaryExtensions.cs new file mode 100644 index 000000000000..cc9412e071d3 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/EventData.cs b/swaggerci/consumption/generated/runtime/EventData.cs new file mode 100644 index 000000000000..a2fe9e32d98d --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/EventDataExtensions.cs b/swaggerci/consumption/generated/runtime/EventDataExtensions.cs new file mode 100644 index 000000000000..8f419ef99be8 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/EventListener.cs b/swaggerci/consumption/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..c9ded3ffa54f --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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.Consumption.Runtime.Extensions; + + public interface IValidates + { + Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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.Consumption.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/Events.cs b/swaggerci/consumption/generated/runtime/Events.cs new file mode 100644 index 000000000000..1a860566afd2 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/EventsExtensions.cs b/swaggerci/consumption/generated/runtime/EventsExtensions.cs new file mode 100644 index 000000000000..cf2e3818f1fe --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Extensions.cs b/swaggerci/consumption/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..57673e7df884 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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.Consumption.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.Consumption.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/consumption/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/consumption/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..b8c32aa770c4 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/consumption/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..fd7856886b60 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Helpers/Seperator.cs b/swaggerci/consumption/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..ec50cf385941 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime.Json +{ + internal static class Seperator + { + internal static readonly char[] Dash = { '-' }; + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/consumption/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..fe2a6104a025 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Helpers/XHelper.cs b/swaggerci/consumption/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..1828ff4defdd --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/HttpPipeline.cs b/swaggerci/consumption/generated/runtime/HttpPipeline.cs new file mode 100644 index 000000000000..5a2daccf7e8d --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/HttpPipelineMocking.ps1 b/swaggerci/consumption/generated/runtime/HttpPipelineMocking.ps1 new file mode 100644 index 000000000000..08aac08c6edf --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/IAssociativeArray.cs b/swaggerci/consumption/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..1539613d9654 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/IHeaderSerializable.cs b/swaggerci/consumption/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..e04aa46b79ad --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime +{ + public interface IHeaderSerializable + { + void ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers); + } +} \ No newline at end of file diff --git a/swaggerci/consumption/generated/runtime/ISendAsync.cs b/swaggerci/consumption/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..63622603edd4 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/InfoAttribute.cs b/swaggerci/consumption/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..d1857401bc47 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Iso/IsoDate.cs b/swaggerci/consumption/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..7256196cd097 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/JsonType.cs b/swaggerci/consumption/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..4a541fa88e46 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/MessageAttribute.cs b/swaggerci/consumption/generated/runtime/MessageAttribute.cs new file mode 100644 index 000000000000..d89cb39e1d06 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/MessageAttributeHelper.cs b/swaggerci/consumption/generated/runtime/MessageAttributeHelper.cs new file mode 100644 index 000000000000..b54e6a6098fe --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/Method.cs b/swaggerci/consumption/generated/runtime/Method.cs new file mode 100644 index 000000000000..9a0d1dbe288c --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Models/JsonMember.cs b/swaggerci/consumption/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..fe64d5a48928 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Models/JsonModel.cs b/swaggerci/consumption/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..cb5d583a1605 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Models/JsonModelCache.cs b/swaggerci/consumption/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..d70ac39d8531 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/consumption/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..e47f928aacbe --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/consumption/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..b110908e5628 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/consumption/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..898c82793db3 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/consumption/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..dd017d1fb9dc --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/consumption/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..0f6021a3b609 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/consumption/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..333fc8b80867 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/JsonDate.cs b/swaggerci/consumption/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..434e3f5a7510 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/JsonNode.cs b/swaggerci/consumption/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..1a4fabf30779 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/consumption/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..2bc762b9b46a --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/JsonObject.cs b/swaggerci/consumption/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..d49b2d54ff11 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/JsonString.cs b/swaggerci/consumption/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..bc704787c317 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/XBinary.cs b/swaggerci/consumption/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..504e0359b2ab --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Nodes/XNull.cs b/swaggerci/consumption/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..70a2d7d5a399 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/consumption/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..ab14fd4af3ac --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Parser/JsonParser.cs b/swaggerci/consumption/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..6825ab9a682b --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Parser/JsonToken.cs b/swaggerci/consumption/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..eeb22e0f50ae --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/consumption/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..44922aa7ff7e --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Parser/Location.cs b/swaggerci/consumption/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..b3fb626c5603 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/consumption/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..68cbfbea6da5 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Parser/TokenReader.cs b/swaggerci/consumption/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..78a074d7895d --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/PipelineMocking.cs b/swaggerci/consumption/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..361663291377 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime +{ + using System.Threading.Tasks; + using System.Collections.Generic; + using System.Net.Http; + using System.Linq; + using System.Net; + using Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.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/consumption/generated/runtime/Properties/Resources.Designer.cs b/swaggerci/consumption/generated/runtime/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..1f4c0c72a2d3 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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.Consumption.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/consumption/generated/runtime/Properties/Resources.resx b/swaggerci/consumption/generated/runtime/Properties/Resources.resx new file mode 100644 index 000000000000..598cd53e958a --- /dev/null +++ b/swaggerci/consumption/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/consumption/generated/runtime/Response.cs b/swaggerci/consumption/generated/runtime/Response.cs new file mode 100644 index 000000000000..d197c765cac4 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/consumption/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..1ad3d1515167 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/consumption/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..3a7595f09cad --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/consumption/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..2cadabc19042 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/SerializationMode.cs b/swaggerci/consumption/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..88039b9e037a --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/TypeConverterExtensions.cs b/swaggerci/consumption/generated/runtime/TypeConverterExtensions.cs new file mode 100644 index 000000000000..a81f60455733 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/UndeclaredResponseException.cs b/swaggerci/consumption/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..1dcc01ab1301 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.Runtime +{ + using System; + using System.Net.Http; + using System.Net.Http.Headers; + using static Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.Runtime.Json.JsonNode.Parse(ResponseBody) as Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/generated/runtime/Writers/JsonWriter.cs b/swaggerci/consumption/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..189920024fb8 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/generated/runtime/delegates.cs b/swaggerci/consumption/generated/runtime/delegates.cs new file mode 100644 index 000000000000..351b97f2e098 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/how-to.md b/swaggerci/consumption/how-to.md new file mode 100644 index 000000000000..172f49aabeb3 --- /dev/null +++ b/swaggerci/consumption/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.Consumption`. + +## Building `Az.Consumption` +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.Consumption` +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.Consumption` +To pack `Az.Consumption` 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.Consumption`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.Consumption.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.Consumption.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.Consumption`. + - `-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.Consumption` 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/consumption/internal/Az.Consumption.internal.psm1 b/swaggerci/consumption/internal/Az.Consumption.internal.psm1 new file mode 100644 index 000000000000..916a8d6999e2 --- /dev/null +++ b/swaggerci/consumption/internal/Az.Consumption.internal.psm1 @@ -0,0 +1,38 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Consumption.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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/consumption/internal/Get-AzConsumptionOperation.ps1 b/swaggerci/consumption/internal/Get-AzConsumptionOperation.ps1 new file mode 100644 index 000000000000..b8e3083a7c08 --- /dev/null +++ b/swaggerci/consumption/internal/Get-AzConsumptionOperation.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 consumption REST API operations. +.Description +Lists all of the available consumption REST API operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionoperation +#> +function Get-AzConsumptionOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.private\Get-AzConsumptionOperation_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/consumption/internal/ProxyCmdletDefinitions.ps1 b/swaggerci/consumption/internal/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..b8e3083a7c08 --- /dev/null +++ b/swaggerci/consumption/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 consumption REST API operations. +.Description +Lists all of the available consumption REST API operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.consumption/get-azconsumptionoperation +#> +function Get-AzConsumptionOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Consumption.Models.Api20211001.IOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Consumption.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.Consumption.private\Get-AzConsumptionOperation_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/consumption/internal/README.md b/swaggerci/consumption/internal/README.md new file mode 100644 index 000000000000..9e21df0311cb --- /dev/null +++ b/swaggerci/consumption/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.Consumption.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.Consumption`. Instead, this sub-module is imported by the `../custom/Az.Consumption.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.Consumption.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.Consumption`. diff --git a/swaggerci/consumption/license.txt b/swaggerci/consumption/license.txt new file mode 100644 index 000000000000..b9f3180fb9af --- /dev/null +++ b/swaggerci/consumption/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/consumption/pack-module.ps1 b/swaggerci/consumption/pack-module.ps1 new file mode 100644 index 000000000000..8ed48957e579 --- /dev/null +++ b/swaggerci/consumption/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/consumption/readme.md b/swaggerci/consumption/readme.md new file mode 100644 index 000000000000..042b58069a17 --- /dev/null +++ b/swaggerci/consumption/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/consumption/resource-manager/readme.md +try-require: + - $(this-folder)/../../../azure-rest-api-specs/specification/consumption/resource-manager/readme.powershell.md +``` diff --git a/swaggerci/consumption/resources/README.md b/swaggerci/consumption/resources/README.md new file mode 100644 index 000000000000..736492341e3d --- /dev/null +++ b/swaggerci/consumption/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/consumption/run-module.ps1 b/swaggerci/consumption/run-module.ps1 new file mode 100644 index 000000000000..bedebf89fcc6 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/test-module.ps1 b/swaggerci/consumption/test-module.ps1 new file mode 100644 index 000000000000..23d98fc87af8 --- /dev/null +++ b/swaggerci/consumption/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.Consumption.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/consumption/test/Get-AzConsumptionAggregatedCost.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionAggregatedCost.Tests.ps1 new file mode 100644 index 000000000000..9b42328b3b1c --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionAggregatedCost.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionAggregatedCost')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionAggregatedCost.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-AzConsumptionAggregatedCost' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get1' -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/consumption/test/Get-AzConsumptionBalance.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionBalance.Tests.ps1 new file mode 100644 index 000000000000..ac557edf2151 --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionBalance.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionBalance')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionBalance.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-AzConsumptionBalance' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get1' -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/consumption/test/Get-AzConsumptionBudget.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionBudget.Tests.ps1 new file mode 100644 index 000000000000..1de284c84914 --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionBudget.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionBudget')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionBudget.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-AzConsumptionBudget' { + 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/consumption/test/Get-AzConsumptionCharge.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionCharge.Tests.ps1 new file mode 100644 index 000000000000..4871e55ee08b --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionCharge.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionCharge')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionCharge.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-AzConsumptionCharge' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionCredit.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionCredit.Tests.ps1 new file mode 100644 index 000000000000..236afe70ac83 --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionCredit.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionCredit')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionCredit.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-AzConsumptionCredit' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionEvent.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionEvent.Tests.ps1 new file mode 100644 index 000000000000..7fdde2543e9d --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionEvent.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionEvent')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionEvent.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-AzConsumptionEvent' { + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionLot.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionLot.Tests.ps1 new file mode 100644 index 000000000000..5798ec0ad330 --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionLot.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionLot')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionLot.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-AzConsumptionLot' { + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List2' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionMarketplace.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionMarketplace.Tests.ps1 new file mode 100644 index 000000000000..f083094725e6 --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionMarketplace.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionMarketplace')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionMarketplace.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-AzConsumptionMarketplace' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionPriceSheet.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionPriceSheet.Tests.ps1 new file mode 100644 index 000000000000..79e3fc34f85c --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionPriceSheet.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionPriceSheet')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionPriceSheet.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-AzConsumptionPriceSheet' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get1' -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/consumption/test/Get-AzConsumptionReservationDetail.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionReservationDetail.Tests.ps1 new file mode 100644 index 000000000000..7ae3a76fc6c5 --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionReservationDetail.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionReservationDetail')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionReservationDetail.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-AzConsumptionReservationDetail' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionReservationRecommendation.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionReservationRecommendation.Tests.ps1 new file mode 100644 index 000000000000..37bdff496dc8 --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionReservationRecommendation.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionReservationRecommendation')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionReservationRecommendation.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-AzConsumptionReservationRecommendation' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionReservationRecommendationDetail.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionReservationRecommendationDetail.Tests.ps1 new file mode 100644 index 000000000000..16175268ead7 --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionReservationRecommendationDetail.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionReservationRecommendationDetail')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionReservationRecommendationDetail.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-AzConsumptionReservationRecommendationDetail' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionReservationSummary.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionReservationSummary.Tests.ps1 new file mode 100644 index 000000000000..47820fab4336 --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionReservationSummary.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionReservationSummary')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionReservationSummary.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-AzConsumptionReservationSummary' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionReservationTransaction.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionReservationTransaction.Tests.ps1 new file mode 100644 index 000000000000..0abe6c671e8e --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionReservationTransaction.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionReservationTransaction')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionReservationTransaction.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-AzConsumptionReservationTransaction' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionReservationsDetail.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionReservationsDetail.Tests.ps1 new file mode 100644 index 000000000000..a985a090640e --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionReservationsDetail.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionReservationsDetail')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionReservationsDetail.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-AzConsumptionReservationsDetail' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionReservationsSummary.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionReservationsSummary.Tests.ps1 new file mode 100644 index 000000000000..62e7d4373ad4 --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionReservationsSummary.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionReservationsSummary')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionReservationsSummary.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-AzConsumptionReservationsSummary' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionTag.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionTag.Tests.ps1 new file mode 100644 index 000000000000..35a75a0f5cf5 --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionTag.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionTag')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionTag.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-AzConsumptionTag' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/Get-AzConsumptionUsageDetail.Tests.ps1 b/swaggerci/consumption/test/Get-AzConsumptionUsageDetail.Tests.ps1 new file mode 100644 index 000000000000..f5e776d67c41 --- /dev/null +++ b/swaggerci/consumption/test/Get-AzConsumptionUsageDetail.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConsumptionUsageDetail')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConsumptionUsageDetail.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-AzConsumptionUsageDetail' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/New-AzConsumptionBudget.Tests.ps1 b/swaggerci/consumption/test/New-AzConsumptionBudget.Tests.ps1 new file mode 100644 index 000000000000..c3bae61914d7 --- /dev/null +++ b/swaggerci/consumption/test/New-AzConsumptionBudget.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzConsumptionBudget')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzConsumptionBudget.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-AzConsumptionBudget' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/README.md b/swaggerci/consumption/test/README.md new file mode 100644 index 000000000000..1969200c6a09 --- /dev/null +++ b/swaggerci/consumption/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/consumption/test/Remove-AzConsumptionBudget.Tests.ps1 b/swaggerci/consumption/test/Remove-AzConsumptionBudget.Tests.ps1 new file mode 100644 index 000000000000..bdddc38b3908 --- /dev/null +++ b/swaggerci/consumption/test/Remove-AzConsumptionBudget.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzConsumptionBudget')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzConsumptionBudget.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-AzConsumptionBudget' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/consumption/test/loadEnv.ps1 b/swaggerci/consumption/test/loadEnv.ps1 new file mode 100644 index 000000000000..0ea394729062 --- /dev/null +++ b/swaggerci/consumption/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/consumption/test/utils.ps1 b/swaggerci/consumption/test/utils.ps1 new file mode 100644 index 000000000000..1990edd45299 --- /dev/null +++ b/swaggerci/consumption/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/consumption/utils/Unprotect-SecureString.ps1 b/swaggerci/consumption/utils/Unprotect-SecureString.ps1 new file mode 100644 index 000000000000..cb05b51a6220 --- /dev/null +++ b/swaggerci/consumption/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